[systemd-devel] Scheduling unit at reboot.target and shutdown.target

Jérémy Rosen jeremy.rosen at smile.fr
Fri Oct 27 09:54:36 UTC 2017


see man:bootup for the general architecture of shutdown and 
man:systemd-shutdown for how to add a script as the "ultimate phase" of 
the shutdown

doing it with services is tricky, your approch will make it be called at 
shutdown but you did not specify "when" during shutdown, so systemd 
might schedule it at any point

you could try to plug it in at the right place using some Before= and 
After= but if that command is the "real shutdown" command, i'd use the 
process described in systemd-shutdown


regards
Jérémy

On 27/10/2017 11:43, D.S. Ljungmark wrote:
> So, I've got a piece of hardware I want to do a final handover to just
> around reboot.target / shutdown.target
>
> This will then cause the entire CPU and hardware allocated to it to
> actually drop power (and schedule re-power), so I don't want to do this
> earlier.
>
>
>
> Is it simply to do:
>
> [Unit]
> DefaultDependencies=no
>
> [Service]
> ExecStart=/usr/bin/big-buck-bunny /dev/i2c-1
> Type=oneshot
>
> [Install]
> WantedBy=reboot.target
>
>
>
> or am I missing something here? ( Perhaps the fact that systemd has
> already pivoted root to somewhere else?)
>
> //D.S.
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- 
SMILE <http://www.smile.eu/>

20 rue des Jardins
92600 Asnières-sur-Seine

	
*Jérémy ROSEN*
Architecte technique
Responsable de l'expertise Smile-ECS

email jeremy.rosen at smile.fr <mailto:jeremy.rosen at smile.fr>
phone +33141402967
url http://www.smile.eu

Twitter <https://twitter.com/GroupeSmile> Facebook 
<https://www.facebook.com/smileopensource> LinkedIn 
<https://www.linkedin.com/company/smile> Github 
<https://github.com/Smile-SA>


Découvrez l’univers Smile, rendez-vous sur smile.eu 
<http://smile.eu/?utm_source=signature&utm_medium=email&utm_campaign=signature>

eco Pour la planète, n'imprimez ce mail que si c'est nécessaire
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20171027/4c8d0980/attachment-0001.html>


More information about the systemd-devel mailing list