On Tue, Sep 15, 2015 at 15:16:30 -0400, Alain Choquet wrote:
> The error in systemd log is not caused by the APM option itself but by the
> failed attempt by hdparm to write output messages to a non existent output.
> On my system a command in /lib/udev/hdparm expands to
> 
> /sbin/hdparm -B254 -q -S119 /dev/sdg
> 

Actually, I believe the error does come from the APM option itself....

At least for hdparm version 9.48+ds-1, the line in /lib/udev/hdparm that
calls the hdparm binary is:
  /sbin/hdparm $OPTIONS $DEVNAME 2>/dev/null

If I try this style of command on the command line and then look at the
exit code, doing a query ("-B") returns a status of 0, but trying to set
the value returns a status of 5:

# hdparm -B /dev/sdb 2>/dev/null ; echo "ret: $?"        
/dev/sdd:
 APM_level      = not supported
ret: 0


# hdparm -B254 /dev/sdd 2>/dev/null ; echo "ret: $?"

/dev/sdd:
 setting Advanced Power Management level to 0xfe (254)
 APM_level      = not supported
ret: 5


Since the /lib/udev/hdparm script runs with "set -e", as soon
as hdparm exits with a status of 5, the entire script does so as well
(thus generating the error that appears in the systemd journal file).


                                                Nathan

Reply via email to