I'm using a simple setup with heartbeat handling a shared filesystem implemented with drbd and served via apache.
I'm using /etc/ha.d/haresources to define the ha resource, this way:
server1 drbddisk::myfs \
Filesystem::/dev/drbd/by-res/myfs::/mnt/myfs::ext4::noatime \
IPaddr::10.0.0.254/24/eth0 apache2
This works fine if using the old debian sysvinit, but has a race problem with systemd because stopping apache is done asyncronously, so when heartbeat issue the "/etc/init.d/apache2 stop" scrypt while it returns very quickly, apache2 can still be active and hence the unmount of the FS fails.
I know a lot of workarounds to solve this problem but I would like to know if there is a "clean" way, without having to revert to sysvinit
Best Answer
Systemd itself (on Debian 8) is just using the good old init-scripts.
That's not a systemd problem. Systemds 'systemctl' also doesn't work asynchronously by default. That's what the
--no-block
option is for. You're also probably not using systemd-tools at all when issuing commands like that in heartbeat.