Timeline for how to start a systemd service before networking starts?
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 22 at 19:11 | comment | added | Alexis Wilke |
That is not sufficient. Without the DefaultDependencies=no, it creates a cycle and doesn't start properly (at the wrong time or not at all...)
|
|
| Apr 21, 2016 at 7:41 | comment | added | deitch |
Ah, got it. Well, I am slowly managing to work it in. Think about it in a different way. Let's say I have an fstab entry that refers to a swap file, but I want a custom script to check and create the swapfile first if it doesn't exist. How would I override the generated fstab unit with a script that creates the file if it doesn't exist?
|
|
| Apr 21, 2016 at 6:33 | comment | added | Alex Jones | I am confused because I dont have experience with encrypted partition, if you can simply me please do so | |
| Apr 20, 2016 at 19:26 | comment | added | deitch | since you definitely have your head around systemd much better than I do, can you look at the other q I have? unix.stackexchange.com/questions/277783/… Still trying to figure out how to do it. | |
| Apr 20, 2016 at 7:55 | comment | added | deitch |
Thanks. I ended up doing Before=network-pre.target and Wants=network-pre.target and for the [Install] we did WantedBy=network.target. The last section forced it to be required by networking, the former put it in order. Was a pain, though
|
|
| Apr 20, 2016 at 6:28 | comment | added | Alex Jones | you can try wanted by = remote-fs.target or mount-fs.target. | |
| Apr 18, 2016 at 14:24 | comment | added | deitch |
Hey @edwardtorvalds, I was doing exactly this for some network config setup, yet the unit appears never to run. The answer to systemctl is-enabled <unit> is always static. Of course, I cannot enable it because there is no WantedBy=. After all, what is it wanted by? This is something that does some setup before the network should load.
|
|
| Oct 31, 2015 at 15:40 | history | answered | Alex Jones | CC BY-SA 3.0 |