[systemd-devel] Restart instantiated services after suspend

Lennart Poettering lennart at poettering.net
Mon Nov 25 19:08:49 PST 2013


On Sat, 23.11.13 18:51, Marcos Felipe Rasia de Mello (marcosfrm at gmail.com) wrote:

> 
> 2013/11/20 Lennart Poettering <lennart at poettering.net>:
> > On Tue, 19.11.13 14:18, Marcos Felipe Rasia de Mello (marcosfrm at gmail.com) wrote:
> >
> >> Hi folks,
> >>
> >> I am trying to disable HDDs power management in a systemd way (aka no
> >> shell scripts :)
> >>
> >> /etc/udev/rules.d/99-hdparm.rules
> >>
> >> SUBSYSTEM=="block", KERNEL=="sd*", ATTR{removable}=="0",
> >> TAG+="systemd", ENV{SYSTEMD_WANTS}+="hdparm@%k.service"
> >
> > Why do you do this asyncrhonously via a systemd service? Given that this
> > tool runs and terminates quickly invokign this with RUN inside of the
> > udev rule itself sounds like the best approach.
> >
> 
> If suspend/resume did not reset HDD power setting, sure, better run
> hdparm directly from the udev rule.
> 
> My initial idea was rerun hdparm@ transient units after suspend with
> something like what you have suggested:
> 
> mkdir /etc/systemd/system/sleep.target.wants
> ln -s /etc/systemd/system/hdparm at .service
> /etc/systemd/system/sleep.target.wants/
> 
> but it did not work so here I am. :)

Maybe you forget "systemctl daemon-reload"?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list