8

I have installed redis server on my Ubuntu based server, so I can start/stop/restart redis server. The redis_server.sh is already in the /etc/init.d.

Now I want to make redis start on boot. I learned from a website that by working with the update_rc.d command, I can add / remove the service on boot.

I tried the update-rc.d to add startup on boot, which doesn't work:

root@ip-172-31-4-108:/etc/init.d# update-rc.d redis-server defaults
//System start/stop links for /etc/init.d/redis-server already exist.

In addition, there are some services I don't want to startup on boot, so I tried:

root@ip-172-31-4-108:/etc/init.d# update-rc.d reids_6379 remove
 Removing any system startup links for /etc/init.d/reids_6379 ...

But when rebooting next time, I still see that service running on boot.

13

For removing services you must use the -f parameter:

sudo update-rc.d -f <service> remove

For configuring startup on boot, try:

sudo update-rc.d <service> enable

See if the following symlink is created:

/etc/rc.2d/S20<service>

or something similar.

  • It doesn't works for me but it does. By some reason enable is not creating the file at /etc/rc.. – deFreitas Jul 14 '18 at 18:26
  • Do you receive an error? Try "sudo update-rc.d <service> defaults" – erny Jul 16 '18 at 18:11
  • No, I ran then it does nothing and give no output – deFreitas Jul 16 '18 at 19:54
  • Debian 9 x64 logged as root – deFreitas Jul 16 '18 at 19:54
  • It's some specific issue with Debian in that version, I already tried it before and it works in Ubuntu at least – deFreitas Jul 16 '18 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.