M HYPE SPLASH
// general

/etc/init.d/rc missing in Ubuntu18.04

By Emma Valentine

I would need to adapt some scripts from Ubuntu 16.04 to Ubuntu 18.04 and /etc/init.d/rc is missing in Ubuntu 18.04.

This path was moved to a different one or everything was migrated to systemd? If it was moved, can you please specify its location in Ubuntu 18.04?

1 Answer

systemd switched off of scripts in /etc/init.d/, and stopped using /etc/rc.local. A similar question was asked on Unix & Linux and the answers provide great explanations with references.

Your immediate thought may be that init scripts are really complicated, and you're unsure how to convert what you have to systemd. Really, setting things up with systemd is a lot easier than with the complicated bash scripts found in /etc/init.d/. There is even a converter, systemd-sysv-generator, that you can use instead.

Some have chosen to use systemd to run the existing scripts, without modification. In this example, /etc/rc.local is run, but you can select which script to run.

/etc/systemd/system/rc-local.service

[Unit]
Description=/etc/rc.local Compatibility
[Service]
Type=forking
ExecStart=/etc/rc.local
TimeoutSec=0
#StandardInput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
systemctl start rc-local # Test it works.
systemctl enable rc-local # Enable run at boot/as configured

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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