• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

service httpd does not support chkconfig

发布: 2007-7-04 12:06 | 作者: admin | 来源:  网友评论 | 查看: 11次 | 进入软件测试论坛讨论

领测软件测试网
[root@firewall init.d]# chkconfig --level 35 httpd on
service httpd does not support chkconfig
一个服务如何才能做到支持chkconfig...?

 sakulagi 回复于:2003-07-01 09:03:28
检查/etc/init.d/httpd是否存在?

 sunyeait 回复于:2003-07-01 09:15:40
No...不存在...
在/etc/rc.d/init.d/下手工撰写一个httpd文件,然后chmod a+x httpd之后,执行:
root@firewall init.d]# chkconfig --level 35 httpd on 
service httpd does not support chkconfig

 sakulagi 回复于:2003-07-01 09:20:53
自己写的缺东西,看看init.d其他的脚本,开头的几行里都会有给chkconfig用的注释。表明一些chkconfig用的信息,具体格式可以参照一下,或是man chkconfig

 sunyeait 回复于:2003-07-01 09:54:39
终于可以了.... 
[root@firewall init.d]# more httpd
#!/bin/sh
#
# Startup script for the Apache Web Server
#
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server.  It is used to serve 
#              HTML files and CGI.
# processname: httpd
# pidfile: /var/run/httpd.pid
# config: /etc/httpd/conf/access.conf
# config: /etc/httpd/conf/httpd.conf
# config: /etc/httpd/conf/srm.conf


# Source function library.
. /etc/rc.d/init.d/functions

# See how we were called.
case "$1" in
  start)
        echo -n "Starting httpd: "
       ***********************
       # daemon httpd
        /usr/local/apache/bin/apachectl start
       ***********************
        echo
        touch /var/lock/subsys/httpd
        ;;
  stop)
        echo -n "Shutting down http: "
        killproc httpd
        echo
        rm -f /var/lock/subsys/httpd
        rm -f /var/run/httpd.pid
        ;;
  status)
        status httpd
        ;;
  restart)
        $0 stop
        $0 start
        ;;
  reload)
        echo -n "Reloading httpd: "
        killproc httpd -HUP
        echo
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|reload|status}"
        exit 1
esac

exit 0
*************************
在末修改前,改变进程状态时提示信息如下:
[root@firewall init.d]# ./httpd stop
Shutting down http: [  OK  ]
[root@firewall init.d]# ./httpd start
Starting httpd: execvp: No such file or directory
[FAILED]
root@firewall init.d]# chkconfig --level 35 httpd on 
service httpd does not support chkconfig 
之后:
我参考了其它RH7.2系统上其它版本的apache的/etc/rc.d/init.d/httpd文件,
只将
    # daemon httpd             (将这行注销掉)
        /usr/local/apache/bin/apachectl start          (换成这行)
然后:
[root@firewall init.d]# chkconfig --level 35 httpd on
就可以了...
请问daemon httpd             中的daemon代表什么..,后台?

 sakulagi 回复于:2003-07-01 10:06:10
后台,作为守护进程。你可以看一下apachectl这个脚本,相信会有些收获。

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网