[Voyage-linux] problems with executing scripts during boot

Gustin Johnson (spam-protected)
Mon Dec 5 00:49:23 HKT 2011


It is also a good idea to use the update-rc.d program to create the
actual links.

On Sun, Dec 4, 2011 at 5:54 AM, Thierry Museux - www.fwt.fr - <tm at fwt.fr> wrote:
> I got this problem.
> With squeeze the init process run differently
> You have to put a header like:
> vi /etc/init.d/waitforusb
> #!/bin/sh
> ### BEGIN INIT INFO
> # Provides:       waitforusb
> # Required-Start: $all
> # Required-Stop: $network
> # Default-Start:  2 3 5
> # Default-Stop:
> # Description:    Wait my usb disk
> ### END INIT INFO
>
> echo "sleep 20 then mount"
> sleep 20
> mount -a
> echo "restart samba"
> sleep 5
> /etc/init.d/samba restart
> sleep 10
> minidlna -R
>
> run
> insserv waitforusb
>
>
> and it should be OK
>
> or run you script in /etc/rc.local
>
> Thierry Museux
> France Wireless Technologies
> www.fwt.fr
> msn: tm at fwt.fr
> Tel: + 33 (0) 1 41 08 70 78
> Gsm: + 33 (0) 6 15 22 09 62
>
>
> -----Message d'origine-----
> De : voyage-linux-bounces+tm=fwt.fr at list.voyage.hk
> [mailto:voyage-linux-bounces+tm=fwt.fr at list.voyage.hk] De la part de Steen
> Pedersen
> Envoyé : dimanche 4 décembre 2011 11:26
> À : voyage-linux at voyage.hk
> Objet : [Voyage-linux] problems with executing scripts during boot
>
> Hi I need to execute a script during booting (I need to make sure the
> extern USB HDD is mounted - which sometime it isn't). I think that
> sometime Voyage starts so fast that it isn't ready when Voyage tries
> to mount it.
> I therefore would like to remount it, restart Samba and Minidlna late
> in the booting process.
>
> So I would like to execute this script (waitforusb) during booting.
> Therefore I made the file waitforusb and put it here;
> /etc/init.d/waitforusb
>
> Waitforusb contains this:
> #!/bin/sh
> echo "sleep 20 then mount"
> sleep 20
> mount -a
> echo "restart samba"
> sleep 5
> /etc/init.d/samba restart
> sleep 10
> minidlna -R
>
> Then I did:
> #chmod 755 /etc/init.d/waitforusb
>
> Then I made links in the different runlevels
> #ln -s /etc/init.d/waitforusb /etc/rcS.d/S25waitforusb
> #ln -s /etc/init.d/waitforusb /etc/rc2.d/S25waitforusb
> #ln -s /etc/init.d/waitforusb /etc/rc3.d/S25waitforusb
> #ln -s /etc/init.d/waitforusb /etc/rc4.d/S25waitforusb
> #ln -s /etc/init.d/waitforusb /etc/rc5.d/S25waitforusb
>
> BUT it wont execute during boot.
>
> If I after a boot write
> # /etc/init.d/waitforusb
>
> Then it execute fine - so why isn't it run during booting?
>
> Please excuse if this is a simple question, but I'm very new to linux.
>
> Regards
> Steen
>
> _______________________________________________
> Voyage-linux mailing list
> Voyage-linux at list.voyage.hk
> http://list.voyage.hk/mailman/listinfo/voyage-linux
>
>
> _______________________________________________
> Voyage-linux mailing list
> Voyage-linux at list.voyage.hk
> http://list.voyage.hk/mailman/listinfo/voyage-linux




More information about the Voyage-linux mailing list