免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3556 | 回复: 15
打印 上一主题 下一主题

service和chkconfig启动服务有什么区别吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-02 15:42 |只看该作者 |倒序浏览
为什么有的服务能用service来启动,而不能用chkconfig来启动呢??它们两个有什么区别吗??

论坛徽章:
0
2 [报告]
发表于 2006-11-02 15:50 |只看该作者
原帖由 hui1983106 于 2006-11-2 15:42 发表
为什么有的服务能用service来启动,而不能用chkconfig来启动呢??它们两个有什么区别吗??


举例说明 ?

--

论坛徽章:
0
3 [报告]
发表于 2006-11-02 16:02 |只看该作者
ldap服务。我自己写了一个启动脚本。只能用service启动,而不能用chkconfig来启动

论坛徽章:
0
4 [报告]
发表于 2006-11-02 16:05 |只看该作者
原帖由 hui1983106 于 2006-11-2 16:02 发表
ldap服务。我自己写了一个启动脚本。只能用service启动,而不能用chkconfig来启动


请你到 /etc/init.d/ 目录看一下里面的文档清单,找其中一个看看前面几行内容,里面会有必要的栏位项目。

==

论坛徽章:
0
5 [报告]
发表于 2006-11-02 16:11 |只看该作者
能不能给举个例子详细说一下?

论坛徽章:
0
6 [报告]
发表于 2006-11-02 16:13 |只看该作者
原帖由 hui1983106 于 2006-11-2 16:11 发表
能不能给举个例子详细说一下?


cat /etc/init.d/cron :


  1. #! /bin/bash
  2. #
  3. # crond          Start/Stop the cron clock daemon.
  4. #
  5. # chkconfig: 2345 90 60
  6. # description: cron is a standard UNIX program that runs user-specified \
  7. #              programs at periodic scheduled times. vixie cron adds a \
  8. #              number of features to the basic UNIX cron, including better \
  9. #              security and more powerful configuration options.
  10. # processname: crond
  11. # config: /etc/crontab
  12. # pidfile: /var/run/crond.pid
  13. #
  14. ### BEGIN INIT INFO
  15. # Provides: crond
  16. # Required-Start: $syslog
  17. # Required-Stop: $syslog
  18. # Default-Start: 2 3 4 5
  19. # Short-Description: The cron clock daemon
  20. # Description: cron is a standard UNIX program that runs user-specified
  21. #              programs at periodic scheduled times. vixie cron adds a
  22. #              number of features to the basic UNIX cron, including better
  23. #              security and more powerful configuration options.
  24. ### END INIT INFO
复制代码


==

论坛徽章:
0
7 [报告]
发表于 2006-11-02 16:18 |只看该作者
哪几行说要用service还是chkconfig来启动了???

论坛徽章:
0
8 [报告]
发表于 2006-11-02 16:19 |只看该作者
如果我写一个脚本要用chkconfig来启动,前面应该加入什么内容呢???

论坛徽章:
0
9 [报告]
发表于 2006-11-02 16:34 |只看该作者
原帖由 hui1983106 于 2006-11-2 16:19 发表
如果我写一个脚本要用chkconfig来启动,前面应该加入什么内容呢???


答案不是已经告诉你了 ? (上面那堆)

--

论坛徽章:
20
CU大牛徽章
日期:2013-04-17 11:48:26羊年新春福章
日期:2015-03-10 22:39:202015年中国系统架构师大会
日期:2015-06-29 16:11:282015亚冠之平阳省
日期:2015-07-31 09:19:042015七夕节徽章
日期:2015-08-21 11:06:17IT运维版块每日发帖之星
日期:2015-09-30 06:20:002015亚冠之柏太阳神
日期:2015-10-19 20:29:5915-16赛季CBA联赛之天津
日期:2016-11-29 14:03:4315-16赛季CBA联赛之北控
日期:2016-12-24 20:51:492015年辞旧岁徽章
日期:2015-03-03 16:54:15双鱼座
日期:2015-01-12 20:58:532014年中国系统架构师大会
日期:2014-10-14 15:59:00
10 [报告]
发表于 2006-11-02 16:43 |只看该作者
那些shell脚本不是全部都注释了吗,还有什么作用啊????
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP