Iniciar en secuencia de booteo
Bueno, eso. Siguiendo instrucciones encontradas en uno de los foros de
popFile <http://popfile.sourceforge.net/>, quise crear un enlace a un
archivito que lanzase el programa en Perl, popFile, en boot time.
Esto es lo que tengo:
$ ls -l /opt/popfile/popfile.pl
-rwxrwxrw- 1 root root 13704 feb 27 18:23 /opt/popfile/popfile.pl
Ese es el ejecutable.
Ahora bien, tengo luego el shell script que adjunto, colocado en
/etc/init.d/
$ ls -l /etc/init.d/popfile
-rwxrwxr-x 1 root root 720 jun 1 01:00 /etc/init.d/popfile
y los siguientes links simbólicos:
$ ls -l /etc/rc0.d/K99popfile
lrwxrwxrwx 1 root root 19 jun 1 01:02 /etc/rc0.d/K99popfile ->
/etc/init.d/popfile
$ ls -l /etc/rc3.d/S99popfile
lrwxrwxrwx 1 root root 19 jun 1 01:01 /etc/rc3.d/S99popfile ->
/etc/init.d/popfile
$ ls -l /etc/rc5.d/S99popfile
lrwxrwxrwx 1 root root 19 jun 1 01:01 /etc/rc5.d/S99popfile ->
/etc/init.d/popfile
... según las instrucciones que encontré en dicho foro.
La cosa es que popfile no se inicia solo. Debo iniciarlo haciendo como
root /etc/init.d/popfile start
¿Estaré manejando mal los runlevels?
Gracias.
P.D.: Cabe acotar que los paths para basename y dirname son correctos.
--
Saludos,
Gabriel Menini
Linux Registered User #207262
#!/bin/sh
echo DESACTIVADO .31
exit
#!/bin/bash
# Sample init.d/script to show how to start popfile
# automatically during regular Redhat Linux 7.3 boot
# Should also work for other versions of Linux
# Change the line below to reflect the location of popfile.pl
popfilelocation=/opt/popfile/popfile.pl
# You may want to do a "ls -l /bin/basename" and
# a "ls -l /usr/bin/dirname" to confirm that you
# have the two utilities on your linux system
prog=`/usr/bin/basename $popfilelocation`
dir=`/usr/bin/dirname $popfilelocation`
case "$1" in
start)
cd $dir
./$prog >> /dev/null 2>&1 &
;;
stop)
pid=`ps -ef | grep "perl \./popfile\.pl" | gawk '{print $2}'`
kill $pid
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0
Reply to: