| ▲ | ndsipa_pomu a day ago | |||||||
Why can't you just call a sysv init script (or other customised script) from a systemd service? I did this just the other day when I wanted to delay starting of docker/nfs-kernel-server until a DRBD disk was mounted. I found problems with doing it just using the standard systemd methods to delay start as having a prerequisite meant that the service would fail to start and not attempt to restart. My solution was to put together a script that would check for the existence of a file (located on the mounted DRBD disk) and sleep for 5 seconds if it didn't exist and as soon as the file did exist, it'd call the systemctl command to start docker etc. Systemd gives you both worlds. | ||||||||
| ▲ | egorfine 4 hours ago | parent [-] | |||||||
Personally I would just throw a script for this service as you have described. Commercially I would do my best to implement this using systemd features, then finally give up and throw a script but with extensive comments describing reasons why it has to be a script instead of a systemd unit file. | ||||||||
| ||||||||