I want to use systemd to configure this, do I have to create a custom target and then custom services on it to make this happen? How do I do that?
Asked
Active
Viewed 594 times
-2
-
That sounds like an XY problem - See https://meta.serverfault.com/questions/3608/how-can-i-ask-better-questions-on-server-fault – Rob May 06 '22 at 13:24
-
What don't you understand about what I just wrote? – daedalus May 06 '22 at 14:00
-
2What you write can be understood, however, it is not clear what what you are trying to achieve, and what you asking for suggests this to be an [XY problem](https://xyproblem.info/). – Lacek May 06 '22 at 14:28
1 Answers
2
You could try creating a .service
that depends on network-online.target
and uses ExecStartPre
to sleep.
The dependency on network-online.target
will mean the service is not started until networking is fully configured.
Using a sleep command in ExecStartPre
will delay the execution of ExecStart
, which is what would run the real program.
This is a partial .service
file that sleeps for 10 seconds after networking is configured.
[Unit]
Requires=network-online.target
After=network-online.target
[Service]
ExecStartPre=/bin/sleep 10
![](../../users/profiles/649608.webp)
Andrew Lowther
- 231
- 1
- 3