[systemd-devel] Restart instantiated services after suspend

Marcos Felipe Rasia de Mello marcosfrm at gmail.com
Tue Nov 19 09:01:22 PST 2013


2013/11/19 Tom Gundersen <teg at jklm.no>:
> On Tue, Nov 19, 2013 at 5:18 PM, 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"
>>
>>
>> /etc/systemd/system/hdparm at .service
>>
>> [Unit]
>> Description=Set disk /dev/%I parameters
>> ConditionFileIsExecutable=/usr/sbin/hdparm
>>
>> [Service]
>> Type=oneshot
>> RemainAfterExit=yes
>> ExecStart=/usr/sbin/hdparm -B254 /dev/%I
>>
>>
>> It works fine, but after the machine wakes up from suspend, I need
>> that all hdparm at .service be run again. Is there a way to accomplish
>> this?
>
> Shouldn't the kernel preserve all such settings during suspend/resume?
>

I do not know. AFAIK, kernel only touches SATA link power settings,
not drive "internal" ones.

--
Marcos


More information about the systemd-devel mailing list