Am 08.08.2013 08:12, schrieb 孙冰:
> I use this:
> ----------------------------------------
> [Unit]
> Description=Wicd sleep hook
> Before=sleep.target
> StopWhenUnneeded=yes
> 
> [Service]
> Type=oneshot
> RemainAfterExit=yes
> ExecStart=-/usr/share/wicd/daemon/suspend.py
> ExecStop=-/usr/share/wicd/daemon/autoconnect.py
> 
> [Install]
> WantedBy=sleep.target
> -----------------------------------------

Thank you very much for this idea. I think it can be expressed in a more
generic way:

----------------------------------------
[Unit]
Description=%I sleep hook
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=-/usr/bin/systemctl stop %I
ExecStop=-/usr/bin/systemctl start %I

[Install]
WantedBy=sleep.target
-----------------------------------------

It would be invoked from sleep-hook@.service.
What do you think?

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to