How to install an init.d script?
When you copy the script into place, don't forget to make it executable and owned by root:
sudo chmod +x /etc/init.d/celeryd
sudo chown root:root /etc/init.d/celeryd
Once you have installed that, you can set it to start automatically on boot with:
sudo update-rc.d celeryd defaults
sudo update-rc.d celeryd enable
Your celeryd
script is probably not executable, that's why sudo /etc/init.d/celeryd
is returning command not found
. So, you need to first make it executable.
To do so, run the following commands:
sudo chmod 755 /etc/init.d/celeryd
sudo chown root:root /etc/init.d/celeryd
The first line changes the permissions to -rwxr-xr-x
, and the second line ensures that the owner and group owner of the file is root
.
Once this is done, I assume you will need to use sudo /etc/init.d/celeryd start
to start the daemon.
If you get the command not found
error when you run insserv
, you may fix it by running the following command:
sudo ln -s /usr/lib/insserv/insserv /sbin/insserv
Then see insserv -h
or man insserv
for help.
Also you can try with:
sudo update-rc.d celeryd defaults
Source: https://askubuntu.com/a/334043/147044