I have a poet database server installed. it comes with a init script. running this init script from the bash "/etc/init.d/poetd start" works. adding it to the default runlevel "rc-update add poetd default" works aswell but it won't get executed on net startup. Reproducible: Always Steps to Reproduce: 1. 2. 3. here's the init script: #!/bin/bash ############################################################## # # Startup script for the Poet 6.1 DB Server # # Date: 20020221 # # Autor: jdb # # Ver: 0.2.4 # # Datei: poetd # # daemon Start | Stop | Status | Restart # # chkonfig: -99 1 # #--- POET PATH ----------------------------------------------- # Mit diesem Link wird festgelegt, welche POET-Version genutzt wird. # Nuetzlich, falls mehrere Versionen von POET installiert sind. # ln -s /opt/poetX.Y /opt/turbomed/dbserver # # Mit diesem Link wird die Datei poetd in das init.d Verzeichnis gelinkt. # Nuetzlich, falls init.d nicht unter /etc liegt. # ln -s /opt/turbomed/bin/poetd /etc/init.d/poetd # # Links (Start,Stop) in den entsprechenden Runlevel erzeugen. # runlevel 1...6 stop 3,5 start # #--- Path -------------------------------------------------- ptserver="/opt/poet61/bin/ptserver" pt_cfg="/opt/turbomed/linux/config/ptserver.cfg" pt_su="/opt/poet61/bin/ptsu" LD_LIBRARY_PATH="/opt/poet61/lib" pt_lock="/var/lock/subsys/poetd" #--- Name --- PROG_NAME="ptserver" ############################################################### # # ! ab hier nicht editieren ! # ############################################################### # System PATHs PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin #--- Start ---------------------------------------------------- start() { export LD_LIBRARY_PATH PROG_GID=`pidof -s $PROG_NAME` #--- test ob schon runing .. if [ ! -x $PROG_GID ] then #--- das Prog leuft schon ---------------------- echo "ist schon runing Prog $PROG_NAME pid: $PROG_GID" #----------------------------------------------- else #--- Start vom Prog ---------------------------- # Ueberpruefung PTserver if [ ! -x $ptserver ] then echo "ERORR PTServer!" exit 1 fi # Ueberpruefung PTserverconfig if [ ! -f $pt_cfg ] then echo "ERORR PTServer config!" exit 1 fi # Start PTServer # noch mal endern "JDB" # echo "START $PROG_NAME" $ptserver -config $pt_cfg & sleep_ while test $(date +%S) -lt 120 do PROG_GID=`pidof -s $PROG_NAME` #--- test ob schon runing .. if [ ! -x $PROG_GID ] then #--- das Prog leuft ----------------------- echo "RUN $PROG_NAME pid: $PROG_GID" echo > $pt_lock exit 0 #------------------------------------------- else #----- echo -n "#" fi done #------------------------------------------------------------------------- fi echo "ERORR $PROG_NAME nicht aktiv ... !!" } #--- Stop ----------------------------------------------------- stop() { # Stop PTServer PROG_GID=`pidof -s $PROG_NAME` if [ ! -x $PROG_GID ] then echo "KILL Prog: $PROG_NAME mit gid: $PROG_GID" kill -9 $PROG_GID else echo "STOP ?" exit 1 fi sleep_ PROG_GID=`pidof -s $PROG_NAME` if [ ! -x $PROG_GID ] then echo "RUN $PROG_NAME ( oder ein zweites Prog $PROG_NAME )" else echo "STOP $PROG_NAME" rm -f $pt_lock fi } #--- Status ----------------------------------------------------- status() { # status PTServer PROG_GID=`pidof -s $PROG_NAME` if [ ! -x $PROG_GID ] then echo "RUN $PROG_NAME pid: $PROG_GID" else echo "STOP $PROG_NAME" fi # Ueberpruefung PTserver if [ ! -x $ptserver ] then echo "ERORR PTServer!" fi # Ueberpruefung PTserverconfig if [ ! -f $pt_cfg ] then echo "ERORR PTServer config!" fi } #--- sleep ---------------------------------------------------- sleep_() { sleep 5 } #--- See how we were called ---------------------------------- case "$1" in start) # 3 * start start start start ;; stop) stop ;; status) status ;; restart) stop sleep_ start ;; *) echo $"Usage: $0 {start|stop|status|restart}" exit 1 esac exit 0 #--- END ---------------------------------------------------
you don't have a depend() section in it. Please see the rc-script guide on www.gentoo.org in the docs section.
in the docs: http://www.gentoo.org/doc/en/handbook/handbook.xml?part=2&chap=5#doc_chap4 I read: "Any init script requires the start() function to be defined. All other sections are optional." So now: Do I need this depend() section, yes or no?
try adding one
added depend() { need net } still doesn't get executed on boot
gentoo-ify that script and then we'll talk
fair enough. so, generally speaking no genuine redhat or suse init script works on gentoo out of the box but has to be converted, right?