You are not logged in.
Pages: 1
Hi guys,
I want a servicefile being executed on every wakeup, bootup as well as recovering from sleep.
The solution I'm thinking of at the moment consists of three servicefiles:
One starting my job, bound to bootup.target or something like this, another one starting the same job bound to sleep.target, a third one that is ment to enable both files when getting enabled itself. This is because I want one servicefile belonging to this one job.
But as this is ugly I would like to have one servicefile. I can bind it easily to sleep.target and bootup.target simply using "WantedBy=" twice, but as the job needs to be executed on *wakeup*, I need to use "After=sleep.target", but I'm afraid that would interfere with activation on bootup, leading to the job being not executed on bootup as bootup is no wakup from sleep and thus sleep.target is not triggered.
Any ideas concerning this? I'd appreciate it.
Last edited by Ovion (2013-09-15 16:53:37)
Offline
I'm using the following for a service I use to set hdd apm after boot/suspend/hibernate and it has been working fine
[Unit]
Description=Set the Advanced Power Management level of a chosen Hard Disk
After=basic.target
After=suspend.target
After=hibernate.target
[Service]
Type=oneshot
ExecStart=your program or script goes here
[Install]
WantedBy=basic.target
WantedBy=suspend.target
WantedBy=hibernate.target
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
It does work? Interesting, thanks, then I'll go this way!
Offline
By the way:
Do After= and Before= mean After-if-this-service-or-target-is-pulled-in-othewise-this-option-is-without-effect= and Before= corresponding?
Offline
By the way:
Do After= and Before= mean After-if-this-service-or-target-is-pulled-in-othewise-this-option-is-without-effect= and Before= corresponding?
yes, After/Before have no effect if the listed units are not part of the start process.
Offline
I see, that vanishes my worries in the first post. Thanks!
Last edited by Ovion (2013-09-15 16:53:23)
Offline
Pages: 1