What happens to /etc/rcS.d in the world of systemd?
Short version of Question:
What does systemd do with scripts in /etc/init.d/rcS?
Loooong version of this question:
So I'm trying to understand how the /var/tmp is created on openembedded.
I have managed to follow things this far....
/var is a directory on /
/var/tmp is a shambolic link to /var/volatile/tmp
/var/volatile is a tmpfs mount point created by
/run/systemd/generator/var-volatile.mount
...before the local-fs.target.
That generator was generated by systemd-fstab-generator which generates systemd .mounts from the /etc/fstab (which has the comment... # stock fstab - you probably want to override this with a machine specific one)
/lib/systemd/system/systemd-tmpfiles-setup.service is run after local-fs.target systemd-sysusers.service and before sysinit.target shutdown.target and runs...
/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev
This scans
/etc/tmpfiles.d/*.conf
/run/tmpfiles.d/*.conf
/usr/lib/tmpfiles.d/*.conf
for config files.
The file
/etc/tmpfiles.d/00-create-volatile.conf
creates the directory /var/volatile/tmp
The file
/usr/lib/tmpfiles.d/tmp.conf
has
q /var/tmp 1777 root root 30d
which means create a directory /var/tmp if it doesn't exist
When the generators are run, the systemd-sysv-generator is run, but it ignores
/etc/rcS.d/S37populate-volatile.sh
as there exists
/etc/systemd/system/populate-volatile.service
which is just a shambolic link to /dev/null
I can verify this using the debug trick mentioned at the bottom of the systemd-generators man page.
This means sysv generator does not generate a .service for /etc/rcS.d/S37populate-volatile.sh, and as it is null, nothing happens.
If populate-volatile.sh would be run, it would use the definitions in
/etc/default/volatiles/00_core
To create a shambolic link from /var/tmp to /var/volatile/tmp (which is what I see)
So it would seem that somehow something is running
/etc/rcS.d/S37populate-volatile.sh
and I don't know why or what.
|