how to use a systemd service, without making it persistent ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to use a systemd service, without making it persistent ?

sean darcy
I want to start a systemd service (dhcpd) , but only if a link to the
internet is present. I don't want the service to start on boot.

systemctl start <service>  doesn't work unless the service is enabled.

This works, but it's very kludgy:

if <link to internet>
  systemctl enable <service>
  systemctl start <service>
  systemctl disable <service>
fi

Any better ideas ?

sean
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: how to use a systemd service, without making it persistent ?

Richard Shaw
On Mon, Apr 9, 2018 at 3:56 PM, sean darcy <[hidden email]> wrote:
I want to start a systemd service (dhcpd) , but only if a link to the internet is present. I don't want the service to start on boot.

There are multiple ways to start a service, you can google that...
 

systemctl start <service>  doesn't work unless the service is enabled.

If that's the case, something is wrong, you should be able to start a service even if it's not enabled.

Thanks,
Richard

_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]