Issues with Advanced Power Manager
Hi Renauld,
I had some issues with advpowermgr-2.3.4b.spk under DSM4.1. Could you please check and comment.
Thanks.
P.S.: BTW, I love your program. (Otherwise I would not have spent the time for fixing these issues ;-).
1) Scheduler.pl never triggered shutdown, because when it came back from sleep for shutdown it always considered the next shutdown time instead of the current time. I changed code in compute_dates_plus_times in Common.pm from:
Rich (BBCode):
if ($date + $time > $start_when) { push ...
to:
Rich (BBCode):
if ($date + $time >= $start_when) { push ...
Now it seems to work, but probably there is a more elegant way of solving this.
Please note that the problem only occured, when "Shutdown only on inactivity" was not activated.
2) Disk activity detection did not work anymore. Reason seems to be that /proc/diskstats uses other names for the drives than expected. I have sda0, sda1 and sda2 (and also sda), but the script seems to search for something like md0, md1 etc.
I changed code in Scheduler.pl from:
Rich (BBCode):
next unless $line =~ m/\d+\s+\d+\s+md\d+\s+\d+\s+\d+\s+(\d+)\s+\d+\s+\d+\s+\d+\s+(\d+)\s+\d+/;
to:
Rich (BBCode):
next unless $line =~ m/\d+\s+\d+\s+sda\d+\s+\d+\s+\d+\s+(\d+)\s+\d+\s+\d+\s+\d+\s+(\d+)\s+\d+/;
Now it works.