知乎专栏 |
for example:
Insert links using the defaults: update-rc.d foobar defaults Equivalent command using explicit argument sets: update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 . More typical command using explicit argument sets: update-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 . Insert links at default runlevels when B requires A update-rc.d script_for_A defaults 80 20 update-rc.d script_for_B defaults 90 10 Insert a link to a service that (presumably) will not be needed by any other daemon update-rc.d top_level_app defaults 98 02 Insert links for a script that requires services that start/stop at sequence number 20 update-rc.d script_depends_on_svc20 defaults 21 19 Remove all links for a script (assuming foobar has been deleted already): update-rc.d foobar remove Example of disabling a service: update-rc.d -f foobar remove update-rc.d foobar stop 20 2 3 4 5 . Example of a command for installing a system initialization-and-shutdown script: update-rc.d foobar start 45 S . stop 31 0 6 . Example of a command for disabling a system initialization-and-shutdown script: update-rc.d -f foobar remove update-rc.d foobar stop 45 S .
set default
update-rc.d nginx defaults
remove
update-rc.d -f lighttpd remove $ sudo update-rc.d -f avahi-daemon remove
$ runlevel N 2 # runlevel N 3
$ sudo vim /etc/init.d/rcS #! /bin/sh # # rcS # # Call all S??* scripts in /etc/rcS.d/ in numerical/alphabetical order # exec /etc/init.d/rc S
the default is S (/etc/rcS.d/)
the redhat linux in the /etc/inittab
switch runlevel
/etc/init.d/rc 3
(ubuntu下sysv-rc-conf命令等同redhat下chkconfig命令)
$ sudo apt-get install sysv-rc-conf
进入sysv-rc-conf TUI用户界面,你可以使用键盘方向键切换,使用空格键选择“X”表示选中,这个软件也支持鼠标操作。
$ sudo sysv-rc-conf
sysv-rc-conf gmond on sysv-rc-conf --list gmond
$ sudo apt-get install xinetd
To see what crontabs are currently running on your system, you can open a terminal and run:
$ crontab -l # m h dom mon dow command #* */30 * * * /home/neo/dyndns
if you want to see root user, please add 'sudo' in the prefix.
To edit the list of cron jobs you can run:
$ crontab -e
As you can see there are 5 stars. The stars represent different date parts in the following order:
minute (from 0 to 59)
hour (from 0 to 23)
day of month (from 1 to 31)
month (from 1 to 12)
day of week (from 0 to 6) (0=Sunday)
By default cron jobs sends a email to the user account executing the cronjob. If this is not needed put the following command At the end of the cron job line .
>/dev/null 2>&1
services directory /etc/service/
$ sudo sv start git-daemon ok: run: git-daemon: (pid 10323) 1s $ sudo sv restart git-daemon ok: run: git-daemon: (pid 10327) 1s $ sudo sv stop git-daemon ok: down: git-daemon: 1s, normally up