All Categories > Problemas Varios > Administracion de servicios en Ubuntu
Los servicios tipo chkconfig de la rama RedHat no están disponibles en la rama debian. Para ello, en las ultimas versiones de ubuntu o centos, se utiliza systemd. Una guía de los comando básicos para operar con ellos es:

SYSTEMD

Starting with Ubuntu 15.04, Upstart will be deprecated in favor of Systemd. With Systemd to manage the services we can do the following:
systemctl start SERVICE - Use it to start a service. Does not persist after reboot
systemctl stop SERVICE - Use it to stop a service. Does not persist after reboot
systemctl restart SERVICE - Use it to restart a service
systemctl reload SERVICE - If the service supports it, it will reload the config files related to it without interrupting any process that is using the service.
systemctl status SERVICE - Shows the status of a service. Tells whether a service is currently running.
systemctl enable SERVICE - Turns the service on, on the next reboot or on the next start event. It persists after reboot.
systemctl disable SERVICE - Turns the service off on the next reboot or on the next stop event. It persists after reboot.
systemctl is-enabled SERVICE - Check if a service is currently configured to start or not on the next reboot.
systemctl is-active SERVICE - Check if a service is currently active.
systemctl show SERVICE - Show all the information about the service.


Los archivos de configuración de los servicios están en la carpeta  /etc/init . Los servicios que están en la vieja carpeta /etc/init.d ya no corren mas, sino mas bien los que están en la nueva carpeta. Un ejemplo de archivo de configuración es esta:

description "The PHP 7.0 FastCGI Process Manager"<br>author "Ondřej Surý <ondrej@debian.org>"
<br># Los viejos runlevel del chkconfig, de inicio y de detencion<br>start on runlevel [2345]<br>stop on runlevel [016]<br><br># Algun script que se quiera correr previo al proceso principal<br>pre-start exec /usr/lib/php/php7.0-fpm-checkconf<br># Modo de proceso, esto es como el inittab, el respawn es para que el 
# servicio se levante cada vez que se caiga<br>respawn

#Ejecutable con todos los parametros<br>exec /usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf

En CENTOS  6.X la metodologia es la misma, solo que el comando es initctl .



 Last updated Tue, Dec 6 2016 4:42pm
Please Wait!

Please wait... it will take a second!