I'm migrating a diskless cluster from initscripts to systemd. The problem I
have is that the nodes each need to mount their own separate /var (identified
by hostname) from the NFS server when they boot.
With initscripts, I used a sysinit_end hook to do the job, which worked pretty
well. However, with systemd I've really hit a brick wall. I can't get the
unit to start early enough, because systemd creates so many sockets (in /var)
so early, and there's no target that is ordered before the socket units are
started. This means that the early sockets get masked when the "real" /var is
mounted, and things break.
I think the only solution with systemd is to explicitly specify each socket in
"Before=" for my unit, which is likely to break if anything changes in future.
It might also be possible to create a generator that automates this, but
that's still pretty ugly.
Right now, I'm thinking the only sensible solution is to forget doing it with
systemd and push the mounting of /var up into initcpio, but that's admitting