如果我启动我的应用程序,我手动启动我的服务,现在我想在启动时启动我的服务,通过我的服务在我的守护程序的init.d文件夹不在启动时调用,任何有想法如何开始 Linux上启动时的守护进程?
这个我的样本但是没有用
#!/bin/sh## myservice This shell script takes care of starting and stopPing# the <myservice>## Source function library. /etc/rc.d/init.d/functions# Do preliminary checks here,if any#### START of preliminary checks ############## END of preliminary checks ######## Handle manual control parameters like start,stop,status,restart,etc.case "" in start) # Start daemons. echo -n $"Starting <myservice> daemon: " echo daemon <myservice> echo ;; stop) # Stop daemons. echo -n $"Shutting down <myservice>: " killproc <myservice> echo # Do clean-up works here like removing pID files from /var/run,etc. ;; status) status <myservice> ;; restart)解决方法 在您的脚本中添加2条评论:# chkconfig: - 90 10# description: description of your servicestopchkconfig --add my_servicestart ;; *) echo $"Usage: {start|stop|status|restart}" exit 1esacexit 0
以root身份运行:
总结以上是内存溢出为你收集整理的Linux守护进程启动全部内容,希望文章能够帮你解决Linux守护进程启动所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)