Startup Management
管理启动的时候跑什么东西的方法。
以下,假定操作对象为<service>。
FreeBSD
- 要自动启动<service>: 编辑/etc/rc.conf,添加<service>_enable="YES"
- 禁止启动<service>: 编辑/etc/rc.conf,删掉<service>_enable="YES",或者<service>_enable="NO"
- 现在启动<service>: service <service> onestart
- 现在停止<service>: service <service> onestop
- 现在启动<service>(假设rc.conf里设置了自动启动): service <service> start
- 现在停止<service>(假设rc.conf里设置了自动启动): service <service> stop
- 检查<service>状态: service <service> status
systemd
- 现在起动<service>: systemctl start <service>
- 现在停止<service>: systemctl stop <service>
- 自动启动<service>: systemctl enable <service>
- 禁止自动启动<service>: systemctl disable <service>
- 检查<service>状态: systemctl status <service>
SysV init
- 现在启动<service>: service <service> start
- 现在停止<service>: service <service> stop
- 自动启动<service>: update-rc.d <service> defaults
- 禁止自动启动<service>: update-rc.d <service> remove
- 检查<service>状态: service <service> status
upstart
- 现在启动<service>: initctl start <service>
- 现在停止<service>: initctl stop <service>
- 自动启动<service>: 编辑/etc/init/<service>.conf,找到start on XXX,修改之,如
start on runlevel [2345]
- 禁止自动启动<service>: 编辑/etc/init/<service>.conf,找到start on XXX,修改之,如
start on runlevel []
- 检查<service>状态: initctl status <service>