Script at /etc/init.d does not run at start-up

11,548

It may be a good way if you use insserv instead of sudo update-rc.d dropbox.sh defaults.

sudo insserv

From man insserv:

insserv  is a low level tool used by update-rc.d which enables an installed sys‐
tem init script (`boot script')

If you get the command not found error, you may fix by running the following command:

sudo ln -s /usr/lib/insserv/insserv /sbin/insserv

See insserv -h for help.

Share:
11,548

Related videos on Youtube

skytreader
Author by

skytreader

Chocolate-consuming, code-churning creature. Check my code at GitHub. #SOreadytohelp ... I hope I'm doing this right!

Updated on September 18, 2022

Comments

  • skytreader
    skytreader over 1 year

    I wanted to run my Dropbox daemon automatically at start-up. I did it via terminal, that is, I (1) moved it to /etc/init.d, (2) made it executable, and (3) ran sudo update-rc.d dropbox.sh defaults. So we have

    $ ll /etc/init.d/dropbox.sh 
    -rwxr-xr-x 1 root root 38 Aug 16 00:18 /etc/init.d/dropbox.sh*
    
    $ cat /etc/init.d/dropbox.sh 
    #! /bin/sh
    ~/.dropbox-dist/dropboxd &
    
    $ ll ~/.dropbox-dist/dropboxd
    -rwxr-xr-x 1 skrd skrd 258 Jun  6 03:03 /home/skrd/.dropbox-dist/dropboxd
    

    However, Dropbox does not run upon start up.

    Note that, invoking /etc/init.d/dropbox.sh runs the dropbox daemon without hitch.

    I know that Ubuntu has a GUI for this and I could easily just add the dropbox script there but I wonder why my terminal commands didn't do it? Isn't that more standard for Linux machines?

  • Zach Bloomquist
    Zach Bloomquist about 5 years
    In Ubuntu 18.10, this advice no longer works and insserv can't be installed. The advice here worked for me: superuser.com/a/449811/458816