Diferenças entre edições de "UBUNTU manage services"

De Wiki do Bernardino
Ir para: navegação, pesquisa
(Disable service)
(Enable service)
Linha 22: Linha 22:
 
===update.rc===
 
===update.rc===
  
The disable|enable API is not stable and might change in the future. I suggest you use the following command to remove all the symlinks in /etc/rc?.d/:
+
Create a service with defaults, foobar example
  
  update-rc.d -f tomcat remove
+
  update-rc.d foobar defaults
  
  

Revisão das 12h23min de 15 de setembro de 2016

Disable service

Disable autostart for a service without uninstalling

update.rc

The disable|enable API is not stable and might change in the future. I suggest you use the following command to remove all the symlinks in /etc/rc?.d/:

update-rc.d -f tomcat remove


upstart

For upstart jobs, you need to disable service like this (e.g. mysql):

$ sudo -s
# echo "manual" > /etc/init/mysql.override


Enable service

Enable a service to autostart

update.rc

Create a service with defaults, foobar example

update-rc.d foobar defaults


upstart

If you put the MySQL service into manual mode and want enable again you can simply do

sudo rm /etc/init/mysql.override