Originally Posted by normvcr
(This is a repost from the software forum, where there were no responses)
I am running
Linux 3.5.0-2.fc17.i686.PAE #1 SMP Mon Jul 30 15:18:54 UTC 2012 i686 i686 i386 GNU/Linux
and one of my services (backuppc) fails to load at boot, even though I had previously done
but does load fine manually after boot:
Sometimes in the system log I see a message from boot-time that the service has failed to access a particular network drive (which the service does need access to).
Is there a way to delay starting up the service until the network drive has been mounted?
SystemD is still experiencing growing pains. The problem is that the services are started in parallel rather than sequentially, so if your service doesn't properly check that services it depends on are fully started and everything is OK, it may try (and fail) to start prematurely.
Now to thoughts towards a solution.
First, there is no such concept as "network drive" in Linux. That is a wrong way of thinking about network filesystem that has polluted your mind thanks to mswondoze.
In Linux, there is the filesystem. Other filesystems can be joined to it to make even bigger filesystems. A network filesystem can be joined to your local filesystem to appear to be a larger filesystem. One option you may have is to apply some link and mount trickery to convince backuppc that the network filesystem is available before it actually is. You may be able to create a filesystem that "looks right" to it, and then have the network filesystem mount over top of it at a later time.
Your other option is to edit the service file for backuppc and adjust it to wait until the network filesystem has already mounted. The service file is located at /usr/lib/systemd/system/backuppc.service
Notice the line that says "After=syslog.target"
Look at the different service files and target files, understand how they set their dependencies, and modify backuppc.service to suit. You might want to pay attention to things like network.target and remote-fs.target
For example, in remote-fs-pre.target, you see "After=network.target nss-lookup.target". I.e., remote filesystem mounting depends on the network being activated.
remote-fs.target is "WantedBy=multi-user.target"
multi-user.target "Requires=sysinit.target sockets.target" and "After=sysinit.target sockets.target".
I think you can get the idea....