ylafont
Posts: 16
Joined: Wed Sep 26, 2012 1:13 am

init.d autostart

Fri Feb 06, 2015 3:33 pm

Wondering of anyone could provide guidance on trouble shooting init.d auto start problems and procedures.

I place this script in /etc/init.d
https://dl.dropboxusercontent.com/u/58850968/scanbd

Chmod it with

Code: Select all

sudo chmod 755 scanbd
ran

Code: Select all

sudo update-rc.d scandb defaults
but all i get with the update command is

Code: Select all

pi@PiScanner /etc/init.d $ sudo update-rc.d  scanbd defautls
update-rc.d: using dependency based boot sequencing
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | SS KK]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
       update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
                -n: not really
                -f: force

Am I missing something? thank you.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: init.d autostart

Fri Feb 06, 2015 4:22 pm

Try using the full path to 'scanbd'

ylafont
Posts: 16
Joined: Wed Sep 26, 2012 1:13 am

Re: init.d autostart

Fri Feb 06, 2015 4:40 pm

at least that gave something

sudo update-rc.d /etc/init.d/scanbd defaults update-rc.d: using dependency based boot sequencing
update-rc.d: error: unable to read /etc/init.d//etc/init.d/scanbd

OS version.
RETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

$ Linux PiScanner 3.18.5+ #744 PREEMPT Fri Jan 30 18:19:07 GMT 2015 armv6l GNU/Linux

RobHenry
Posts: 452
Joined: Fri Sep 21, 2012 9:04 pm
Location: UK

Re: init.d autostart

Fri Feb 06, 2015 4:42 pm

ylafont wrote:Wondering of anyone could provide guidance on trouble shooting init.d auto start problems and procedures.

I place this script in /etc/init.d
https://dl.dropboxusercontent.com/u/58850968/scanbd

Chmod it with

Code: Select all

sudo chmod 755 scanbd
ran

Code: Select all

sudo update-rc.d scandb defaults
but all i get with the update command is

Code: Select all

pi@PiScanner /etc/init.d $ sudo update-rc.d  scanbd defautls
update-rc.d: using dependency based boot sequencing
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | SS KK]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
       update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
                -n: not really
                -f: force

Am I missing something? thank you.
You've got two typos in there:

scanbd & defautls

ylafont
Posts: 16
Joined: Wed Sep 26, 2012 1:13 am

Re: init.d autostart

Fri Feb 06, 2015 7:17 pm

You've got two typos in there:
scanbd & defautls
that was done prior to my second cup of coffee this morning. don't know where my head is it today. sorry for the confusion.

previous post have the correct info.

standard file name

Code: Select all

pi@PiScanner /etc/init.d $ sudo update-rc.d scanbd defaults
update-rc.d: using dependency based boot sequencing
pi@PiScanner /etc/init.d $
command with full path.

Code: Select all

pi@PiScanner /etc/init.d $ sudo update-rc.d /etc/init.d/scanbd defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: error: unable to read /etc/init.d//etc/init.d/scanbd

RobHenry
Posts: 452
Joined: Fri Sep 21, 2012 9:04 pm
Location: UK

Re: init.d autostart

Fri Feb 06, 2015 7:24 pm

Always best to have plenty of coffee before posting.

Of the two examples you provided the second failed, obviously, because you didn't need the full path, but the first one looks as though it was successful. Did any error messages accompany it?

ylafont
Posts: 16
Joined: Wed Sep 26, 2012 1:13 am

Re: init.d autostart

Fri Feb 06, 2015 7:49 pm

Nothing at all. nothing in syslog, messages, kern daemon logs., I did not see the usual response when adding a script to startup.

Code: Select all

oot@skx:~# update-rc.d blah defaults
 Adding system startup for /etc/init.d/blah ...
   /etc/rc0.d/K20blah -> ../init.d/blah
   /etc/rc1.d/K20blah -> ../init.d/blah
   /etc/rc6.d/K20blah -> ../init.d/blah
   /etc/rc2.d/S20blah -> ../init.d/blah
   /etc/rc3.d/S20blah -> ../init.d/blah
   /etc/rc4.d/S20blah -> ../init.d/blah
   /etc/rc5.d/S20blah -> ../init.d/blah


Which begs me to ask if it was working and see what if there is anything else i can check?

RobHenry
Posts: 452
Joined: Fri Sep 21, 2012 9:04 pm
Location: UK

Re: init.d autostart

Fri Feb 06, 2015 7:57 pm

Have the symbolic links been set up?

Try:

ls /etc/rc*/*scandb*

and see what is returned.

ylafont
Posts: 16
Joined: Wed Sep 26, 2012 1:13 am

Re: init.d autostart

Fri Feb 06, 2015 8:06 pm

Code: Select all

pi@PiScanner /etc $ [b]sudo ls /etc/rc*/*scandb*[/b]
ls: cannot access /etc/rc*/*scandb*: No such file or directory
pi@PiScanner /etc $


but...
ls rc* in ./etc/ produces and show them there.

Code: Select all

rc0.d:
K01alsa-utils    K01lightdm  [b] K01scanbd[/b]        K02sendsigs      K05rpcbind     K08umountroot
K01cgroup-bin    K01plymouth  K01triggerhappy  K03rsyslog       K06hwclock.sh  K09halt
K01fake-hwclock  K01samba     K01urandom       K04umountnfs.sh  K06networking  README
K01ifplugd       K01saned     K01xinetd        K05nfs-common    K07umountfs

rc1.d:
K01alsa-utils    K01ifplugd  K01saned         K01xinetd      K05rpcbind   S01killprocs
K01cgroup-bin    K01lightdm [b] K01scanbd[/b]        K03rsyslog     README       S01motd
K01fake-hwclock  K01samba    K01triggerhappy  K05nfs-common  S01bootlogs  S02single

rc2.d:
K01lightdm     S01bootlogs    S01rsyslog  S01triggerhappy    S02ntp     S03saned
K05nfs-common  S01cgroup-bin  S01samba    S02cron            S02rsync   S04plymouth
K05rpcbind     S01ifplugd     [b]S01scanbd [/b]  S02dbus            S02ssh     S04rc.local
README         S01motd        S01sudo     S02dphys-swapfile  S02xinetd  S04rmnologin

rc3.d:
K05nfs-common  S01cgroup-bin  S01samba         S02cron            S02rsync    S03saned
K05rpcbind     S01ifplugd     [b]S01scanbd   [/b]     S02dbus            S02ssh      S04plymouth
README         S01motd        S01sudo          S02dphys-swapfile  S02xinetd   S04rc.local
S01bootlogs    S01rsyslog     S01triggerhappy  S02ntp             S03lightdm  S04rmnologin

rc4.d:
K05nfs-common  S01cgroup-bin  S01samba         S02cron            S02rsync    S03saned
K05rpcbind     S01ifplugd     [b]S01scanbd [/b]       S02dbus            S02ssh      S04plymouth
README         S01motd        S01sudo          S02dphys-swapfile  S02xinetd   S04rc.local
S01bootlogs    S01rsyslog     S01triggerhappy  S02ntp             S03lightdm  S04rmnologin

rc5.d:
K05nfs-common  S01cgroup-bin  S01samba         S02cron            S02rsync    S03saned
K05rpcbind     S01ifplugd    [b] S01scanbd [/b]       S02dbus            S02ssh      S04plymouth
README         S01motd        S01sudo          S02dphys-swapfile  S02xinetd   S04rc.local
S01bootlogs    S01rsyslog     S01triggerhappy  S02ntp             S03lightdm  S04rmnologin

rc6.d:
K01alsa-utils    K01lightdm   [b]K01scanbd[/b]        K02sendsigs      K05rpcbind     K08umountroot
K01cgroup-bin    K01plymouth  K01triggerhappy  K03rsyslog       K06hwclock.sh  K09reboot
K01fake-hwclock  K01samba     K01urandom       K04umountnfs.sh  K06networking  README
K01ifplugd       K01saned     K01xinetd        K05nfs-common    K07umountfs

rcS.d:
K05hwclock.sh      S03keyboard-setup          S09mountall-bootclean.sh  S15console-setup
K12rpcbind         S04mountdevsubfs.sh        S10procps                 S16alsa-utils
K13nfs-common      S05checkroot.sh            S10udev-mtab              S16bootmisc.sh
README             S06checkroot-bootclean.sh  S10urandom                S16plymouth-log
S01fake-hwclock    S06kmod                    S11networking             S16raspi-config
S01hostname.sh     S06mtab.sh                 S12mountnfs.sh            S16x11-common
S01mountkernfs.sh  S07checkfs.sh              S13mountnfs-bootclean.sh
S02udev            S08mountall.sh             S14kbd

ylafont
Posts: 16
Joined: Wed Sep 26, 2012 1:13 am

Re: init.d autostart

Fri Feb 06, 2015 9:32 pm

Got It!

The Devil is in the details!!!! Jesus can't believe this.

the script has a line for the executable that needed to point o SBIN rather than BIN

Code: Select all

DAEMON=/usr/local/bin/$NAME
A little error message saying the file could not be found would have saved me hours!


Thanks for the Assistance! and again sorry for the confusion!

Return to “Beginners”