1.查看服务列表
[root@ytj ~]# cd /etc/init.d
[root@ytj init.d]# ll
总用量 328
-rwxr-xr-x. 1 root root 1288 11月 23 2013 abrt-ccpp
-rwxr-xr-x. 1 root root 1628 11月 23 2013 abrtd
-rwxr-xr-x. 1 root root 1642 11月 23 2013 abrt-oops
-rwxr-xr-x. 1 root root 1725 8月 19 2010 acpid
-r-xr-xr-x 1 root root 3712 11月 25 2014 aksusbd
-rwxr-xr-x. 1 root root 2062 1月 30 2012 atd
-rwxr-xr-x. 1 root root 3378 6月 22 2012 auditd
-rwxr-xr-x. 1 root root 4043 11月 23 2013 autofs
-r-xr-xr-x. 1 root root 1340 11月 24 2013 blk-availability
-rwxr-xr-x. 1 root root 2094 2月 22 2013 certmonger
-rwxr-xr-x. 1 root root 5160 11月 23 2013 cgconfig
-rwxr-xr-x. 1 root root 3580 11月 23 2013 cgred
-rw-r--r-- 1 root root 0 9月 17 15:25 config
-rwxr-xr-x. 1 root root 11355 8月 13 2013 cpuspeed
-rwxr-xr-x. 1 root root 2826 11月 23 2013 crond
-rwxr-xr-x. 1 root root 3034 8月 17 2013 cups
lrwxrwxrwx 1 root root 23 8月 18 17:34 dpch -> /usr/local/vspu/dpch.sh
-rw-r--r--. 1 root root 18586 10月 10 2013 functions
-rwxr-xr-x. 1 root root 1801 7月 20 2011 haldaemon
-rwxr-xr-x. 1 root root 5866 10月 10 2013 halt
-rwxr-xr-x. 1 root root 10804 11月 23 2013 ip6tables
-rwxr-xr-x. 1 root root 10688 11月 23 2013 iptables
-rwxr-xr-x. 1 root root 1938 8月 23 2013 irqbalance
-rwxr-xr-x. 1 root root 18133 11月 23 2013 kdump
-rwxr-xr-x. 1 root root 652 10月 10 2013 killall
-r-xr-xr-x. 1 root root 2134 11月 24 2013 lvm2-lvmetad
-r-xr-xr-x. 1 root root 2665 11月 24 2013 lvm2-monitor
-rwxr-xr-x. 1 root root 2034 11月 22 2013 mcelogd
-rwxr-xr-x. 1 root root 2571 10月 11 2013 mdmonitor
-rwxr-xr-x. 1 root root 2200 9月 14 2012 messagebus
lrwxrwxrwx 1 root root 29 9月 19 16:26 monitor -> /usr/local/monitor/monitor.sh
-rwxr-xr-x. 1 root root 2989 10月 10 2013 netconsole
-rwxr-xr-x. 1 root root 5428 10月 10 2013 netfs
-rwxr-xr-x. 1 root root 6334 10月 10 2013 network
-rwxr-xr-x. 1 root root 6364 11月 22 2013 nfs
-rwxr-xr-x. 1 root root 3526 11月 22 2013 nfslock
-rwxr-xr-x. 1 root root 1923 7月 15 2013 ntpd
-rwxr-xr-x. 1 root root 2043 7月 15 2013 ntpdate
-rwxr-xr-x. 1 root root 1875 10月 15 2012 numad
-rwxr-xr-x. 1 root root 2261 6月 25 2011 oddjobd
-rwxr-xr-x. 1 root root 1076 6月 24 2015 oracle
2.以monitor服务为例
以下为 /usr/local/monitor/monitor.sh脚本内容
3.这样就可以通过service monitor start或service monitor stop来开启或关闭服务monitor
那么如何建立软链接呢,如下图所示: