0

I've known that Debian and Ubuntu have used systemd to manage the services running at boot time.

I've known that there were /etc/rcX.d/ and /etc/init.d/, which are also about services running at boot time.

Now I want to know how do /etc/rcX.d/, /etc/init.d/ and systemd work together.

After reading
https://manpages.debian.org/stretch/systemd/systemd-sysv-generator.8.en.html
and
How does systemd use /etc/init.d scripts?
and
https://stackoverflow.com/questions/21901385/whats-the-exactly-differences-of-etc-init-d-something-and-etc-rc-local
I'm confused now.

It seems that systemd will transform the scripts in /etc/rcX.d and in /etc/init.d into the service that can be read by systemd. But what is the rule of the transformation? The first link and the second link told me that systemd would transform the script in /etc/init.d into the service, which is after basic.target, and the script in /etc/rcX.d into the service, which is Wanted-By multi-user.target. But the third link told me that /etc/rcX.d/ contains many soft links to the scripts located in /etc/init.d/. Doesn't this make any conflict?

For me, it seems that adding script in /etc/init.dand in /etc/rcX.d is the same because adding script in both of them can be execute at boot time.

  • I did not tell you that /etc/rc?.d contains scripts. I explicitly wrote "symbolic link farms". – JdeBP Feb 25 at 9:53
  • It says "symbolic link farms" at unix.stackexchange.com/a/394191/5132 too. – JdeBP Feb 25 at 10:11
  • @JdeBP thanks a lot dude, let me read it again. – Yves Feb 25 at 10:27

Your Answer

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

Browse other questions tagged or ask your own question.