User Tools

Site Tools


informatica:linux:runlevel

This is an old revision of the document!


Runlevels

Para añadir un servicio en los diferentes niveles de ejecución: Creamos el script en /etc/init.d indicando runlevel y posición de arranque y parada. Por ejemplo le damos el nombre servicio:

#! /bin/bash

# chkconfig: 2345 90 60

case "$1" in
start)

        runuser usuario -c "script_start.sh"

        ;;

stop)
        runuser usuario -c "script_stop.sh"

        ;;
*)
        echo $"Usage: $0 {start|stop}"
        exit 1
esac
exit $?

Añadimos el servicio:

# chkconfig --add servicio

Ahora ya lo podemos administrar con chkconfig

# chkconfig --list |grep -i sendmail
sendmail        0:off   1:off   2:on    3:on    4:on    5:on    6:off
# chkconfig --level 2 sendmail off
# chkconfig --list |grep -i sendmail
sendmail        0:off   1:off   2:off    3:on    4:on    5:on    6:off

Debian

Copiar el ejecutable en /etc/init.d

#update-rc.d ddclient defaults

Deshabilitar en niveles:

#update-rc.d ntlmaps disable 2 3 4 5
informatica/linux/runlevel.1373456673.txt.gz · Last modified: 2015/04/13 20:19 (external edit)