On Wed, 07.08.13 10:12, Mathijs Kwik (math...@bluescreen303.nl) wrote:
> Hi all,
>
> I have a few things that need to get run after waking up my laptop
> (things like hdparm to set device power options/spindown time).
> I created oneshot, remainafterexit services for those and made them
> wanted
Hi,
Yep. I have the exact same sleep@.service and it works.
BTW, sleep.target is pulled in by both suspend.target and
hibernate.target. There are some use cases that a hook should be only
invoked by suspend.target (or hibernate.target). For instance, I have a
hook used with the tuxoniceui:
-
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/wic
孙冰 writes:
> 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.
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
Indeed, that sounds like a solution.
It's a bit of a philosophical thing though, remainafterexit+oneshot
works nicely for things that represent a certain state (powersaving
on) which can be inspected and turned off.
oneshot "scripts" don't feel natural to me somehow without such a
state (which Re
On Wed, Aug 7, 2013 at 10:12 AM, Mathijs Kwik wrote:
> I have a few things that need to get run after waking up my laptop
> (things like hdparm to set device power options/spindown time).
> I created oneshot, remainafterexit services for those and made them
> wanted by multi-user.target.This works
Hi all,
I have a few things that need to get run after waking up my laptop
(things like hdparm to set device power options/spindown time).
I created oneshot, remainafterexit services for those and made them
wanted by multi-user.target.This works fine for the first boot.
As I consider these servic