标签:
二、Linux服务管理
[root@centos ~]# vi /etc/rc.local
1 #!/bin/sh
2 #
3 # This script will be executed *after* all the other init scripts.
4 # You can put your own initialization stuff in here if you don‘t
5 # want to do the full Sys V style init stuff.
6
7 touch /var/lock/subsys/local
8 /etc/rc.d/init.d/httpd start
[root@centos init.d]# ls
abrt-ccpp cpuspeed iptables netfs psacct rsyslog udev-post
abrtd crond irqbalance network quota_nld sandbox winbind
abrt-oops cups kdump nfs rdisc saslauthd ypbind
acpid functions killall nfslock restorecond single
atd haldaemon lvm2-lvmetad ntpd rngd smartd
auditd halt lvm2-monitor ntpdate rpcbind sshd
autofs htcacheclean mdmonitor oddjobd rpcgssd sssd
blk-availability httpd messagebus portreserve rpcidmapd sysstat
certmonger ip6tables netconsole postfix rpcsvcgssd tomcat6
1、RPM包安装服务独立的服务启动: ① /etc/rc.d/init.d/httpd start 推荐② service httpd start自启动:① chkconfig --level 2345 httpd on|off② vi /etc/rc.local 推荐/etc/rc.d/init.d/httpd start基于xinetd的服务(越来越少了,不讲了)2、源码包服务启动: /usr/local/apache2/bin/apachect1 start自启动: vi /etc/rc.local/usr/local/apache2/bin/apachect1 start
源码包的安装位置:/usr/local/RPM包的安装位置:/etc/rc.d/init.d
[root@localhost ~]# ps aux |grep crond
root 1364 0.0 0.1 7148 1284 ? Ss 17:34 0:01 crond
root 1592 0.0 0.0 5980 728 pts/0 S+ 18:16 0:00 grep crond
标签:
原文地址:http://www.cnblogs.com/lxw89/p/4683082.html