Linux command
update-rc.d 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Install
update-rc.d [mysql] defaults
Enable
update-rc.d [mysql] enable
Disable
update-rc.d [mysql] disable
Forcibly remove
update-rc.d -f [mysql] remove
说明
update-rc.d installs and removes System-V style init script links. It manages the symbolic links in /etc/rc?.d/ directories that control which services start at each runlevel. Init scripts must be placed in /etc/init.d/ before using this command. The tool is primarily used on Debian-based systems using traditional SysV init.
参数
- defaults
- Add service with default start/stop runlevels
- enable
- Enable service to start at boot
- disable
- Disable service from starting at boot
- remove
- Remove all symlinks for the service
- -f, --force
- Force removal even if init script still exists
- -n
- Dry run, show what would be done
FAQ
What is the update-rc.d command used for?
update-rc.d installs and removes System-V style init script links. It manages the symbolic links in /etc/rc?.d/ directories that control which services start at each runlevel. Init scripts must be placed in /etc/init.d/ before using this command. The tool is primarily used on Debian-based systems using traditional SysV init.
How do I run a basic update-rc.d example?
Run `update-rc.d [mysql] defaults` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does defaults do in update-rc.d?
Add service with default start/stop runlevels