I am in the process of upgrading a sysv-based system to systemd (CentOS 6 -> 7), and I would like to rely on systemd-sysv-generator
to run some of services that still have their scripts under /etc/init.d.
The problem is, some of the files under /etc/init.d are actually soft links to files on a secondary partition.
It looks like this partition is not yet mounted when systemd-sysv-generator
runs, and all I see in the log is a bunch of "no such file or directory" errors from the generator script. Systemd documentation says that the generators run "very early at bootup", and the processing of /etc/fstab happens much later.
I think what I need to do is somehow make initramfs or the kernel mount the secondary drive, but I don't know if that's possible. The responses for this and this questions are not very encouraging, and seem to suggest that this is at the very least an unorthodox approach.
Another option might be to re-run the generator after the drive has been mounted, but I don't know how to do that, and whether it will be "too late", so to speak, and the services will get created but not started.
What should I do?
EDIT: To make it more concrete, let's say my root partition is at /dev/sda1
, and I have a secondary partition at /dev/sda2
, usually mounted as /secondary
. /etc/init.d/myservice
is a symbolic link to /secondary/myservice
. This used to work fine, but stopped working under systemd for the reasons mentioned.