简单分类:基于xinetd 服务和自定的服务和自己写的代码的服务启动。
利用chkconfig --list查看开机启动的服务(Ubuntu *deb) 服务 /etc/init.d/ 下面shell脚本可以利用service启动
/etc/init.d/服务名 {start | stop | restart | status } 服务的启动方法
service 服务名 {start | stop | restart | status} service搜索的目录/etc/init.d
root@liujie-desktop:/etc/init# chkconfig --list
acpi-support 0:off 1:off 2:on 3:on 4:on 5:on 6:off
acpid 0:off 1:off 2:off 3:off 4:off 5:off 6:off
alsa-mixer-save 0:off 1:off 2:off 3:off 4:off 5:off 6:off
anacron 0:off 1:off 2:off 3:off 4:off 5:off 6:off
apparmor 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on
apport 0:off 1:off 2:off 3:off 4:off 5:off 6:off
atd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
avahi-daemon 0:off 1:off 2:off 3:off 4:off 5:off 6:off
binfmt-support 0:off 1:off 2:on 3:on 4:on 5:on 6:off
bluetooth 0:off 1:off 2:on 3:on 4:on 5:on 6:off
bootlogd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
brltty 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on
console-setup 0:off 1:off 2:off 3:off 4:off 5:off 6:off
cron 0:off 1:off 2:off 3:off 4:off 5:off 6:off
cups 0:off 1:off 2:on 3:on 4:on 5:on 6:off
dbus 0:off 1:off 2:off 3:off 4:off 5:off 6:off
dmesg 0:off 1:off 2:off 3:off 4:off 5:off 6:off
dns-clean 0:off 1:on 2:on 3:on 4:on 5:on 6:off
failsafe-x 0:off 1:off 2:off 3:off 4:off 5:off 6:off
fancontrol 0:off 1:off 2:on 3:on 4:on 5:on 6:off
gdm 0:off 1:off 2:off 3:off 4:off 5:off 6:off
grub-common 0:off 1:off 2:on 3:on 4:on 5:on 6:off
hostname 0:off 1:off 2:off 3:off 4:off 5:off 6:off
hwclock 0:off 1:off 2:off 3:off 4:off 5:off 6:off
hwclock-save 0:off 1:off 2:off 3:off 4:off 5:off 6:off
irqbalance 0:off 1:off 2:off 3:off 4:off 5:off 6:off
kerneloops 0:off 1:off 2:on 3:on 4:on 5:on 6:off
killprocs 0:off 1:on 2:off 3:off 4:off 5:off 6:off
lm-sensors 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on
module-init-tools 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network-interface 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network-interface-security 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network-manager 0:off 1:off 2:off 3:off 4:off 5:off 6:off
networking 0:on 1:off 2:off 3:off 4:off 5:off 6:off
ondemand 0:off 1:off 2:on 3:on 4:on 5:on 6:off
pcmciautils 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on
plymouth 0:off 1:off 2:off 3:off 4:off 5:off 6:off
plymouth-log 0:off 1:off 2:off 3:off 4:off 5:off 6:off
plymouth-splash 0:off 1:off 2:off 3:off 4:off 5:off 6:off
plymouth-stop 0:off 1:off 2:off 3:off 4:off 5:off 6:off
pppd-dns 0:off 1:on 2:on 3:on 4:on 5:on 6:off
procps 0:off 1:off 2:off 3:off 4:off 5:off 6:off
pulseaudio 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rc.local 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rcS 0:off 1:off 2:off 3:off 4:off 5:off 6:off
rsync 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rsyslog 0:off 1:off 2:off 3:off 4:off 5:off 6:off
saned 0:off 1:off 2:on 3:on 4:on 5:on 6:off
screen-cleanup 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on
sendsigs 0:on 1:off 2:off 3:off 4:off 5:off 6:off
speech-dispatcher 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ssh 0:off 1:off 2:off 3:off 4:off 5:off 6:off
stop-bootlogd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
stop-bootlogd-single 0:off 1:off 2:off 3:off 4:off 5:off 6:off
tftpd-hpa 0:off 1:off 2:off 3:off 4:off 5:off 6:off
udev 0:off 1:off 2:off 3:off 4:off 5:off 6:off
udev-finish 0:off 1:off 2:off 3:off 4:off 5:off 6:off
udevmonitor 0:off 1:off 2:off 3:off 4:off 5:off 6:off
udevtrigger 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ufw 0:off 1:off 2:off 3:off 4:off 5:off 6:off
umountfs 0:on 1:off 2:off 3:off 4:off 5:off 6:off
umountnfs.sh 0:on 1:off 2:off 3:off 4:off 5:off 6:off
umountroot 0:on 1:off 2:off 3:off 4:off 5:off 6:off
unattended-upgrades 0:on 1:off 2:off 3:off 4:off 5:off 6:off
urandom 0:on 1:off 2:off 3:off 4:off 5:off 6:off S:on
vsftpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
wpa-ifupdown 0:on 1:off 2:off 3:off 4:off 5:off 6:off
x11-common 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on
xinetd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
xinetd based services:
chargen: off
daytime: on
discard: off
echo: off
time: off
源码包的安装服务 一般/usr/local
不能用service 命令,因为搜索/etc/init.d/ 目录下找不到
服务的自启动:
chkconfig --level 2345 服务名 {on | off}
在 /etc/rc.local 文件开机启动项 (for Ubuntu)
利用sysv-rc-conf (for Ubuntu)软件图形化界面设置开机自启动;在Red-hat系列(ntsysv)
基于xinetd的服务,修改配置文件 etc/xinetd.d/服务
如果是源码包,就按照安装目录安装说明README中说明了服务启动方式和脚本名称
另外: 如果自己写的程序需要设置为服务管理,可参见 linux注册自定TFTP服务