Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/06/2006, 09:13
Avatar de -Defero-
-Defero-
Colaborador
 
Fecha de Ingreso: julio-2004
Ubicación: Guipúzcoa
Mensajes: 4.776
Antigüedad: 19 años, 9 meses
Puntos: 76
El script que comentas es éste, y el contenido es el mismo que el del archivo que he puesto antes:

Cita:
root@dan:[/]# cat /etc/rc0.d/K11cron | grep -v \#

test -f /usr/sbin/cron || exit 0

. /lib/lsb/init-functions

case "$1" in
start) log_begin_msg "Starting periodic command scheduler..."
start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
log_end_msg $?
;;
stop) log_begin_msg "Stopping periodic command scheduler..."
start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid --name cron
log_end_msg $?
;;

restart) log_begin_msg "Restarting periodic command scheduler..."
start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/crond.pid --name cron
start-stop-daemon --start --quiet --pidfile /var/run/crond.pid --name cron --startas /usr/sbin/cron -- $LSBNAMES
log_end_msg $?
;;
reload|force-reload) log_begin_msg "Reloading configuration files for periodic command scheduler..."
log_end_msg 0
;;
*) log_success_msg "Usage: /etc/init.d/cron {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0
root@dan:[/]#
De hecho, según el README que se encuentra en el directorio /etc/rc0.d, ese archivo no es más que un enlace simbólico al otro archivo. Por eso el contenido es igual.

Cita:
root@dan:[/etc/rc0.d]# cat README
The scripts in this directory are executed once when entering
runlevel 0.

The scripts are all symbolic links whose targets are located in
/etc/init.d/ .


Generally it is not necessary to alter the scripts in this directory.
Their purpose is to stop all services and to make the system ready
for shutdown.

For a more information see /etc/init.d/README.
root@dan:[/etc/rc0.d]# ls -l | grep cron
lrwxrwxrwx 1 root root 14 2005-12-31 23:00 K11cron -> ../init.d/cron

root@dan:[/etc/rc0.d]#
La cuestión es que no hay ningún problema para detener CRON mediante el código de ese script:

Cita:
root@dan:[/etc/init.d]# ps aux c | grep cron
root 12024 0.0 0.3 2208 864 ? Ss 17:10 0:00 cron
root@dan:[/etc/init.d]# start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid --name cron
root@dan:[/etc/init.d]# ps aux c | grep cron
root@dan:[/etc/init.d]#
Se me ocurre que el problema puede no ser de CRON, sino del siguiente proceso de la lista, que se resiste a terminar. No sé cuál es el siguiente proceso (se agradecen sugerencias), aunque yo probaría a seguir un orden alfabético. Así que el siguiente es CUPSYS.

Cita:
root@dan:[/etc/init.d]# cat cupsys | grep -v \#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/cupsd
NAME=cupsd
PIDFILE=/var/run/cups/$NAME.pid

DESC="Common Unix Printing System"

test -f $DAEMON || exit 0

set -e

if [ -e /etc/timezone ]; then
TZ=`cat /etc/timezone`
export TZ
fi

case "$1" in
start)
echo -n "Starting $DESC: $NAME"
chown root:lpadmin /usr/share/cups/model 2>/dev/null || true
chmod 3775 /usr/share/cups/model 2>/dev/null || true
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec $DAEMON
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
start-stop-daemon --stop --quiet --user root --retry TERM/10 --oknodo --pidfile $PIDFILE --name $NAME
echo "."
;;
reload)
echo -n "Reloading $DESC: $NAME"
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --signal 1
echo "."
;;
restart|force-reload)
echo -n "Restarting $DESC: $NAME"
if start-stop-daemon --stop --quiet --user root --retry TERM/10 --oknodo --pidfile $PIDFILE --name $NAME; then
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec $DAEMON
fi
echo "."
;;
status)
echo -n "Status of $DESC: "
if [ ! -r "$PIDFILE" ]; then
echo "$NAME is not running."
exit 3
fi
if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then
echo "$NAME is running."
exit 0
else
echo "$NAME is not running but $PIDFILE exists."
exit 1
fi
;;
*)
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac

exit 0
root@dan:[/etc/init.d]#
Voy a probar a detener CUPSD sustituyendo las variables en el código:

Cita:
root@dan:[/etc/init.d]# ps aux c | grep cups
root 6133 0.0 0.7 5904 1952 ? Ss 15:04 0:00 cupsd
root@dan:[/etc/init.d]# start-stop-daemon --stop --quiet --user root --retry TERM/10 --oknodo --pidfile cupsd.pid --name cupsd
root@dan:[/etc/init.d]# ps aux c | grep cups
root@dan:[/etc/init.d]#
El proceso se detiene sin problemas.

Parece ser que no es problema de CUPS, y tampoco de CRON. Si estoy en lo cierto, debería averiguar qué proceso es el que se detiene justo después de CRON, y revisar su script. Pero no tengo ni idea de cómo averiguar eso. Agradecería que alguien me orientara, estoy demasiado perdido. Estoy revisando los logs de /var/log, pero no sé muy bien lo que debo buscar, y de momento no encuentro nada útil.
__________________
abogado en Errenteria + procuradora en San Sebastián = equipo imparable