Re: start y stop
On Thu, Mar 07, 2002 at 05:49:04PM +0100, Sergio Rua wrote:
> start)
> echo -n "Starting $DESC: "
> start-stop-daemon --start --pidfile /var/run/partimaged/$NAME.pid \
> --chuid partimag --make-pidfile --exec $DAEMON -- $OPTS
>
> echo "$NAME."
> ;;
> stop)
> echo -n "Stopping $DESC: "
> start-stop-daemon --stop --chuid partimag --pidfile /var/run/partimaged/$NAME.pid
> echo "$NAME."
> ;;
>
> El start lo hace bien y genera el partimaged.pid pero el
> problema es que el pid que pone no es el correcto.
>
> La pregunta es, ¿cómo obtengo el pid verdadero?
¿Para qué necesitas el pid?
Sugiero que hagas algo como esto:
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --chuid partimag --exec $DAEMON -- $OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --exec $DAEMON
echo "$NAME."
;;
Funcionará siempre a no ser que haya varios procesos $DAEMON
ejecutándose y no quieras matar todos.
--
.+'''+. .+'''+. .+'''+. .+'''+. .+''
Juan Cespedes / \ / \ cespedes@debian.org
.+' `+...+' `+...+' `+...+' `+...+'
Reply to: