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.

Yves
  • 3,291

0 Answers0