Quantcast
Channel: 钻戒 and 仁豆米
Viewing all articles
Browse latest Browse all 290

Ubuntu下的Service启动和停止

$
0
0

CentOS下可以用chkconfig来控制服务的启动和停止,那么Ubuntu下该怎么做呢?

确实比较麻烦:

步骤如下,查看服务器启动时自动启动的服务:

R=$(runlevel  | awk '{ print $2}')  
for s in /etc/rc${R}.d/*; do  basename $s | grep '^S' | sed 's/S[0-9].//g' ;done  

结果如下:

agentwatch  
cloudmonitor  
confluence  
jenkins  
nginx  
nscd  
polipo  
sysstat  
ntp  
aegis  
apache2  
rc.local  

如果要停止apache2的自启动:

update-rc.d -f apache2 remove  
update-rc.d apache2 stop 20 2 3 4 5 .  

Viewing all articles
Browse latest Browse all 290

Trending Articles