/********************************************************************* * Author:samson * date:03/19/2015 * Test PL Atform: * GCC (Ubuntu 4.8.2-19ubuntu1) 4.8.2 * GNU bash, 4.3.11 (1)-release (X86_64-PC-LINUX-GNU) * *******************************************************************/
Debian system startup script
The Debian Gnu/linux uses the SYSV module as the system initial script. Like RH, Debian uses an extended SYSV module, while the Slackware is primarily BSD-based, and several handy scripts are written to use the SysV module.
Locating the SYSV directory
The Debian Gnu/linux, like most systems using the SysV module, stores the relevant directories in/etc directory. That is, the SYSV directory/etc/init.d is the script itself, and/etc/rc1.d,/etc/rc2.d until/ETC/RC6.D is a special run-level directory.
Get the current list of services:
Service--status-all
[Email protected]:/etc/rcs.d# service--status-all
[+] Acpid
[ ? ] Alsa-utils
[-] Anacron
[+] ATD
[+] Avahi-daemon
[ ? ] Binfmt-support
[+] Bluetooth
[-] Bootlogs
[ ? ] bootmisc.sh
[ ? ] checkfs.sh
[ ? ] checkroot-bootclean.sh
[-] Checkroot.sh
[-] Console-setup
[+] Cron
[+] Cups
[+] Dbus
[+] Exim4
[+] Gdm3
[ ? ] Hdparm
[-] Hostname.sh
[ ? ] hwclock.sh
[-] Kbd
[-] Keyboard-setup
[ ? ] Killprocs
[ ? ] Kmod
[+] MiniSSDPd
[-] Motd
[ ? ] mountall-bootclean.sh
[ ? ] mountall.sh
[ ? ] mountdevsubfs.sh
[ ? ] mountkernfs.sh
[ ? ] mountnfs-bootclean.sh
[ ? ] mountnfs.sh
[ ? ] Mpt-statusd
[ ? ] mtab.sh
[+] Network-manager
[ ? ] Networking
[+] Nfs-common
[ ? ] Pppd-dns
[-] Procps
[+] PulseAudio
[ ? ] Rc.local
[-] Rmnologin
[+] Rpcbind
[+] Rsyslog
[+] Saned
[ ? ] Sendsigs
[ ? ] Speech-dispatcher
[-] SSH
[-] sudo
[+] Udev
[ ? ] Udev-mtab
[ ? ] Umountfs
[ ? ] umountnfs.sh
[ ? ] Umountroot
[-] Unattended-upgrades
[-] Urandom
[-] X11-common
where [+] represents a service item that is now running, [-] indicates that the current service is not running.
Turn off the service entry (for example, SSH service):
[Email protected]:/etc/rcs.d# service SSH start
[OK] Starting OpenBSD Secure Shell server:sshd.
[Email protected]:/etc/rcs.d# service SSH stop
[OK] Stopping OpenBSD Secure Shell server:sshd.
You can also use the INVOKE-RC.D command for service execution, and so on.
use of Service entry effective/void:
UPDATE-RC.D [-N] name disable|enable [s|2|3|4|5]
Access to the Debian GNU Linux Service list, service shutdown/Open, service automatically running at startup/expiration