/etc/rc.d/init.d下的脚本,需要a+x权限
#!/bin/sh
#
# ident "@(#)mipagent 1.1 99/11/06 SMI"
#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
case "$1" in
'start')
cd /www
python index.py 80&
;;
'stop')
pkill -x -u 0 -P 1 python index.py
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
然后在/etc/rc.d/rc3.d下建立连接即可
redhat linux的自启动脚本
最新推荐文章于 2021-08-03 09:38:16 发布
本文介绍了一个用于启动和停止Python Web服务的Shell脚本。该脚本通过在/etc/rc.d/init.d目录下运行来实现对/www目录下index.py文件的服务控制,并提供了start和stop两个操作选项。
6227

被折叠的 条评论
为什么被折叠?



