在当前大多数Linux发行版中可能都会包含这两个命令,这两个命令为我们控制Linux中的服务(守护进程)提供了很大的方便,先看看这两条命令的帮助:
[root@localhost ~]# service --help
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]
[root@localhost ~]# chkconfig --help
chkconfig 版本 1.3.29 - 版权 (C) 1997-2000 Red Hat, Inc.
在 GNU 公共许可的条件下,本软件可以被自由发行。
用法: chkconfig --list [name]
chkconfig --add
chkconfig --del
chkconfig [--level ] <on|off|reset|resetpriorities>
在我的系统上sshd默认不在系统服务列表里边,下面以sshd命令说明他们的用法:
输入service sshd会列出可用的一些操作:
[root@localhost ~]# service sshd
用法:/etc/init.d/sshd {start|stop|restart|reload|condrestart|status}
启动sshd服务:service sshd start
停止sshd服务:service sshd stop
将sshd添加到服务列表里边:chkconfig --add sshd
[root@localhost ~]# service --help
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]
[root@localhost ~]# chkconfig --help
chkconfig 版本 1.3.29 - 版权 (C) 1997-2000 Red Hat, Inc.
在 GNU 公共许可的条件下,本软件可以被自由发行。
用法: chkconfig --list [name]
chkconfig --add
chkconfig --del
chkconfig [--level ] <on|off|reset|resetpriorities>
在我的系统上sshd默认不在系统服务列表里边,下面以sshd命令说明他们的用法:
输入service sshd会列出可用的一些操作:
[root@localhost ~]# service sshd
用法:/etc/init.d/sshd {start|stop|restart|reload|condrestart|status}
启动sshd服务:service sshd start
停止sshd服务:service sshd stop
将sshd添加到服务列表里边:chkconfig --add sshd