I'm trying to set up a new service (under Debian Jessie) that needs to set up some mounts where the network configuration is stored and thus this service must complete before networking.service starts.Being a newbie to systemd, I tried the following:[Unit]Description=mount/repair remaining filesystems (all persistent fs beyond /)#Before=network-pre.targetBefore=networking.service[Service]Type=oneshotExecStart=/opt/intermodul-mounts/start.shTimeoutSec=0RemainAfterExit=yes[Install]RequiredBy=networking.serviceUsing systemd-analyze plot I can see that my service starts, but networking.service starts about 3 seconds earlier:Apparently my config is wrong, but I'm having a hard time finding the problem... Any help greatly appreciated..UpdateI currently solved it by changing the service config to start before local-fs.target instead of networking.service:[Unit]DefaultDependencies=noDescription=mount/repair remaining filesystems (all persistent fs beyond /)Before=local-fs.target[Service]Type=oneshotExecStart=/opt/intermodul-mounts/start.shTimeoutSec=0RemainAfterExit=yes[Install]RequiredBy=local-fs.targetStill, I'd like to understand why my first configuration didn't work as expected...?
how to start a systemd service before networking starts?
systemd