Summary: | app-laptop/hdapsd-20090401-r1 add support of removable disk to init script | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Uwe Sauter <uwe> |
Component: | Current packages | Assignee: | Christoph Junghans (RETIRED) <junghans> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
The new config file for monitoring multiple disks
The initial script for hdapsd services fixed init.d/hdapsd diff agains files/hdapsd.init |
Description
Uwe Sauter
2010-08-25 13:06:17 UTC
A workaround would be to change /etc/conf.d/hdapsd: Change OPTIONS="-a" to OPTIONS="-a -d sdb" Created attachment 247998 [details]
The new config file for monitoring multiple disks
I just change the DISK option to DISKLIST option.
Created attachment 247999 [details]
The initial script for hdapsd services
With this script and the new config file, hdapsd can monitor multiple disks.
(In reply to comment #1) > A workaround would be to change /etc/conf.d/hdapsd: > > Change > OPTIONS="-a" > to > OPTIONS="-a -d sdb" > I just thought this might be a little ugly. It might be better that someone change the script file and config file in the portage tree. (In reply to comment #2 & #3) DISKLIST works for me. I can choose either disk or both. Only the chosen one gets monitored. Can you put this into the portage tree? (In reply to comment #4) > I just thought this might be a little ugly. Yeah. That was just quick & dirty. (In reply to comment #2 & #3) DISKLIST works for me. I can choose either disk or both. Only the chosen one gets monitored. Can someone put this into the portage tree and close the bug? (In reply to comment #4) > I just thought this might be a little ugly. Yeah. That was just quick & dirty. Added in hdapsd-20090401-r1, please test! Created attachment 296605 [details, diff]
fixed init.d/hdapsd
the initscript included with the hdapsd-20090401-r1.ebuild passes only the last device in the DISKLIST to hdapsd
Fixed, thanks! I am using a modified version of the init script for a long time now. I also wanted it to support more than one disk. Yesterday i got -r1 which added this feature which i never reported. But the new init script is missing one important point. The second disk is usually sitting in the ultrabay and is removeable, meaning it is not always around. I hotswap the DVD drive and the disk. Whenever i insert a new device udev will restart hdapsd. My version of the init script will not fail if one of the disks on the list does not exist or does not support the unload feature. It will generate a warning and skip that disk. That way i can have both disks on the list and the init script will start hdapsd even if only one of the two is present. I will attach the script i am using. I did not report this bug because i thought not a lot of gentoo users would actually have a disk in the ultrabay, or care about it being monitored by hdapsd. Created attachment 296659 [details, diff]
diff agains files/hdapsd.init
in the conf file DISK is simply a list, i did not rename it to DISKLIST
DISK="sda sdb"
please reopen and let us get the new init script right so that it will not fail when one of the disks is not present Thinking about it more carefully the list does not have to be there at all, because one could just look for the unload_heads file in all the the block device directories. If the script did that by default hdapsd would monitor all possible devices by default. Having a disklist conf variable might still be usefull for people that want to exclude devices for some reason. Good point, I thought more about 2 disks in the laptop itself. Henning, can you create a diff against hdapsd.init.2? Is there something else needed to make udev trigger a restart of hdapsd? If no -d option is given hdapsd try to auto-detect devices. It looks for all devices in /sys/block/ for a device/unload_heads or queue/protect file. Additionally it checks if the file is removable or not and don't watch any removable devices. I think this would be a good default option. So no DISK variable and no selection in initscript is needed. Incorporated auto-detecting support in hdapsd-20090401-r2. We still need to trigger restart of hdapsd by udev if a disk was removed/added. No response after 1 year, I changed to a different thinkpad with a ssd, so I don't use hdapsd anymore. Feel free to re-open if needed. |