Bug 63041

Summary: Set disk attributes also on system resume, not just system boot
Product: udisks Reporter: Kamil Páral <kparal>
Component: generalAssignee: Martin Pitt <martin.pitt>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium CC: agustin, mcatanzaro, reklov, sylvain.pasche, thoemy, tom.ty89, webczat_200
Version: unspecified   
Hardware: Other   
OS: All   
See Also: https://bugzilla.gnome.org/show_bug.cgi?id=759864
Whiteboard:
i915 platform: i915 features:

Description Kamil Páral 2013-04-02 18:38:53 UTC
I used palimpsest to set APM of my hard drive to 254 (the vendor default is 128). It correctly created this file:

> $ cat /etc/udisks2/WDC-WD1600BEVS-08RST2-WD-WXC308394315.conf 
> # See udisks(8) for the format of this file.
> 
> [ATA]
> APMLevel=254

On every system boot, my HDD APM is 254 instead of 128, which is correct.

However, if I suspend the machine and resume it, the APM is back to 128. I assume udisks sets the disk properties only on clean boot, but not on system resume. Because system suspend powers down the HDD, on resume it runs with vendor defaults (128).

Please set disk attributes (like APM) also on system resume, not just system boot.

udisks2-2.0.1-1.fc18.x86_64
Comment 1 Kamil Páral 2013-04-25 12:29:05 UTC
The same holds for disk spindown attribute (StandbyTimeout=), on resume it is not set. Since I usually reboot once a week, but suspend and resume every day, this is rather inconvenient.
Comment 2 David Zeuthen (not reading bugmail) 2013-04-25 12:36:12 UTC
Yes, we should do this. I think the kernel emits a signal when the system resumes, I think all we need to do is to listen for this.
Comment 3 Jan Alexander Steffens (heftig) 2015-03-18 07:28:16 UTC
I'm also suffering from this. I guess all udisks needs to do reapply the settings when logind's PrepareForSleep(false) signal is received?
Comment 4 Jan Alexander Steffens (heftig) 2015-04-02 22:08:09 UTC
How do you enumerate all UDisksDriveObjects in order to reapply their configuration? Ask the UDisksDaemon for all objects, then filter the GList by instance type?

What would be the best spot to implement listening to the PrepareForSleep signal? I assume this will be conditional on HAVE_LIBSYSTEMD_LOGIN.
Comment 5 Agustín Dall'Alba 2015-06-16 11:43:20 UTC
*** Bug 90985 has been marked as a duplicate of this bug. ***
Comment 6 Sylvain Pasche 2015-10-05 22:27:06 UTC
Ugly workaround I've been using (requires a systemd based system):

cat > /etc/systemd/system/udisks2-resume.service << EOF 
# Workaround for https://bugs.freedesktop.org/show_bug.cgi?id=63041
[Unit]
Description=Restart udisks2 on resume
After=suspend.target

[Service]
Type=simple
ExecStart=/usr/bin/systemctl restart udisks2.service

[Install]
WantedBy=suspend.target
EOF

systemctl daemon-reload 
systemctl enable udisks2-resume.service
Comment 7 Tom Yan 2015-10-16 00:39:05 UTC
*** Bug 92479 has been marked as a duplicate of this bug. ***
Comment 8 Tom Yan 2016-02-29 21:26:37 UTC
*** Bug 91690 has been marked as a duplicate of this bug. ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.