I’ve come across this problem from time to time…
i.e. even though my remote mounts are in /etc/fstab, and do get mounted (eventually, without intervention), services that rely on them won’t startup properly…
e.g. on my Orange Pi +2E running Armbian (essentially boobuntu 16.04 "server"on armhf) - transmission-daemon wouldn’t start via systemd on boot, because the filesystem it needed was an NFS mount that got mounted sometime after systemd tried to start transmission-daemon… I gave up trying to figure that out - I hardly ever reboot it - so when I do reboot it - or lose power - I just SSH to it and run a script to mount the NFS share - THEN - start transmission-daemon…
Just been doing some reading - it looks pretty complicated - creating and configuring systemd unit files for ensuring certain mounts are mounted, and editing the UNIT file for the dependant service, so that it “needs” to have that dependancy UNIT file satisfied…
Anyways - just came across something similar in my job today - on a RHEL system, apache (RHEL family always call it “httpd”, but Debian family nearly always call it “apache2”) - httpd won’t start on boot and much of the default vserver/documentroot in httpd.conf file uses stuff on an NFS share… I guess I need to write a unit file for that and then force httpd to ensure that dependancy is resolved before starting up…
FAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHK ! I sure miss SysV Init sometimes!!!
How much easier was it to either have the one startup script (or two separate scripts) in /etc/init.d/ to
- mount dependancy filesystem
- start daemon / app / service and fork it to bg
Or even:
- /etc/rc.d/rc3.d/S90-mount-my-shite
- /etc/rc.d/rc3.d/S99-start-my-shite
The only thing I “like” about systemd is - that it mostly seems to work, and it’s REALLY good at running stuff as a user account (e.g. I run Resilio Sync with “systemctl --user start resilio-sync.service”) - that’s too easy - and I’m scratching my head with perplexity if I try to do something similar on a platform that DOESN’T DO SYSTEMD… hmmm…