son of FrontPage

Step 1

so I first create my '' peterd_startup.sh '' with this

http://rob.pectol.com/startup_scriptbuilder/

the annoying thing is, even you run this script for the first time manually, you see this

root@girl:/etc/init.d# ./mydaemon_startup.sh start
 - Starting mydaemon...                                                                                                                                      [: 86: unexpected operator
Already running!
                                                                                                                                                      [ OK ]
root@girl:/etc/init.d#
so I need this patch to fix this problem
d_start() {
        if [ -f /var/run/mydaemon ]; then
                pid*`cat /var/run/mydaemon`
        else
                pid*""
        fi
---     if [ "$pid" ** "" ]; then
+++     if [ -z $pid ]; then
                start-stop-daemon --start --pidfile /var/run/mydaemon --make-pidfile --exec /usr/bin/mydaemon -- -v -T
        else
why is this? :-) i really need to study bash

and I aslo have a FdSyntaxError

Step 2

root@girl:~# update-rc.d  peterd_startup.sh start  23 5 .
update-rc.d: warning: /etc/init.d/peterd_startup.sh missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/peterd_startup.sh ...
   /etc/rc5.d/S23peterd_startup.sh -> ../init.d/peterd_startup.sh
root@girl:~#
later I checked and found ubuntu gnome default runlevel is not 5 but 2 with
pet@girl:~/.moin-1.8.5$ runlevel
N 2
but this is easy to fix, all I need is
mv /etc/rc5.d/S23peterd_startup.s /etc/rc2.d

Step 3

so it works, interesting is this

root@girl:/etc/rc2.d# ls -l S23peterd_startup.sh
lrwxrwxrwx 1 root root 27 2009-10-28 10:57 S23peterd_startup.sh -> ../init.d/peterd_startup.sh
root@girl:/etc/rc2.d#
here

''rc2.d'' means runlevel 2

''s23'' is start sequence we give to '''update-rc.d'''