User Tools

Site Tools


informatica:linux:runlevel

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatica:linux:runlevel [2010/03/17 18:07] 83.247.136.12informatica:linux:runlevel [2019/12/04 09:21] (current) osk-k-k-k
Line 1: Line 1:
-Runlevel+====== Runlevels ====== 
 + 
 +===== Red Hat ===== 
  
 Para añadir un servicio en los diferentes niveles de ejecución: 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:
 +<code>
 +#! /bin/bash
  
-Red Hat:+# chkconfig2345 90 60
  
-# chkconfig --list |grep -i sendmail+case "$1" in 
 +start)
  
-sendmail        0:off   1:off   2:on    3:on    4:on    5:on    6:off+        runuser usuario -c "script_start.sh"
  
-# chkconfig --level 2 sendmail off+        ;;
  
-# chkconfig --list |grep -i sendmail+stop) 
 +        runuser usuario -c "script_stop.sh"
  
-sendmail        0:off   1:off   2:off    3:on    4:on    5:on    6:off+        ;; 
 +*) 
 +        echo $"Usage: ${start|stop}" 
 +        exit 1 
 +esac 
 +exit $? 
 +</code>
  
 +Damos permisos de ejecución:
 +  # chmod +x /etc/init.d/servicio
  
-Debian:+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 
 +   
 +Para activar un servicio: 
 +  chkconfig --list rngd 
 +  rngd            0:off 1:off 2:off 3:off 4:off 5:off 6:off 
 + 
 +  chkconfig rngd on 
 + 
 +  chkconfig --list rngd 
 +  rngd            0:off 1:off 2:on 3:on 4:on 5:on 6:off 
 + 
 +   
 + 
 + 
 +===== Debian ===== 
 + 
 +<code> 
 +#! /bin/bash 
 + 
 +# Required-Start:    $syslog 
 +# Required-Stop:     $syslog 
 +# Default-Start:     2 3 4 5 
 +# Default-Stop:      0 1 6 
 + 
 +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 $? 
 +</code>
  
 Copiar el ejecutable en /etc/init.d Copiar el ejecutable en /etc/init.d
  
-#update-rc.d ddclient defaults+  #update-rc.d ddclient defaults
  
 Deshabilitar en niveles: \\ Deshabilitar en niveles: \\
-#update-rc.d ntlmaps disable 2 3 4 5+  #update-rc.d ntlmaps disable 2 3 4 5 
 + 
 +Herramientas gráficas pero de líneas de comando:   
 +  rcconf sysv-rc-conf   
informatica/linux/runlevel.txt · Last modified: 2019/12/04 09:21 by osk-k-k-k