[systemd-devel] Method to Wait for service to complete

killermoehre killermoehre at gmx.net
Wed Aug 12 12:32:42 PDT 2015


Am 12.08.2015 um 20:34 schrieb Harry Goldschmitt:
> I have a service that has to complete before boot can continue. Is there
> an “approved” method for doing this?
> 
>  
> 
> I have an ugly solution I’ve come up with… I’ve created a foo.target to
> run my foo.service and set the default.target to my foo.target. After my
> foo.service completes, I’m issuing “systemctl isolate multi-user” to
> complete the boot.
> 
>  
> 
> Any help would be appreciated.
> 
>  
> 
> Harry

Because my first answer wasn't send to the ML, here again:

> Hello Harry,
>
> so the first question here always is: why do you think your service
> is so important that no other service should be run at the same time?
> Can you give us more information about your service? Some
> explanaition what it does and why it should run before boot completes
> (which is quite the funny thing, because "boot end" is never defined
> with systemd, because everyting is brought up in parallel only taking
> dependencies in account).
>
> Regards

Harrys answer

> My product is a Linux network appliance and my service updates
> platform and peripheral firmware as needed without human
> intervention. For the updates to take effect, the platform needs to
> be rebooted after updates. If a network card needs new firmware, the
> network is shut down before the update. If a peripheral needs to be
> updated, it is shutdown, too. It would probably be a bad idea to let
> users log into the appliance only to shutdown peripherals and then
> reboot after a firmware update. In addition we have several services
> that should not be brought up before it is known that firmware needs
> to be updated.
>
> Before systemd, we just ran the service early in the boot process.
> 99.9% of the time the service did nothing and boot continued. If
> something had to be updated, the service did the update and rebooted.

In the end after I got his answer it boils down to
http://www.freedesktop.org/wiki/Software/systemd/SystemUpdates/

Regards


More information about the systemd-devel mailing list