Bug 866734 - systemd failed to start hdapsd service on boot
systemd failed to start hdapsd service on boot
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: hdapsd (Show other bugs)
17
i686 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Tomasz Torcz
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-15 22:37 EDT by Stefan Jensen
Modified: 2012-11-10 12:53 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-06 01:47:23 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stefan Jensen 2012-10-15 22:37:22 EDT
Description of problem:

systemd failed to start hdapsd service on boot.

Version-Release number of selected component (if applicable):

hdapsd-20090401-10.fc17.i686

systemd-sysv-44-17.fc17.i686
systemd-analyze-44-17.fc17.i686
systemd-44-17.fc17.i686

How reproducible:

Always

Steps to Reproduce:
1. Install hdapsd on a thinkpad
2. reboot
3. service failed to start
  
Actual results:

shock protection not available, service not started

Expected results:

service started, shock protection useable

Additional info:

Just after reboot:

#systemctl status hdapsd@sda.service

hdapsd@sda.service - sda shock protection daemon
	  Loaded: loaded (/usr/lib/systemd/system/hdapsd@.service; static)
	  Active: failed (Result: exit-code) since Tue, 16 Oct 2012 04:16:19 +0200; 1min 46s ago
	 Process: 515 ExecStart=/usr/sbin/hdapsd -d %I $HDAPSD_OPTIONS (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/hdapsd@.service/sda

hdapsd(sda)[515]: Tue Oct 16 04:16:19 2012: Could not read from /sys/devices/platform/hdaps/p...e busy
hdapsd(sda)[515]: Tue Oct 16 04:16:19 2012: Could not read position from sysfs.
hdapsd(sda)[515]: Tue Oct 16 04:16:19 2012: Starting hdapsd
hdapsd(sda)[515]: Tue Oct 16 04:16:19 2012: Selected interface: HDAPS
hdapsd(sda)[515]: Tue Oct 16 04:16:19 2012: Selected HDAPS input device: /dev/input/event8

A simple restart fix it:

#sudo systemctl restart hdapsd@sda.service
#sudo systemctl status hdapsd@sda.service

hdapsd@sda.service - sda shock protection daemon
	  Loaded: loaded (/usr/lib/systemd/system/hdapsd@.service; static)
	  Active: active (running) since Tue, 16 Oct 2012 04:18:32 +0200; 2s ago
	Main PID: 1698 (hdapsd)
	  CGroup: name=systemd:/system/hdapsd@.service/sda
		  └ 1698 /usr/sbin/hdapsd -d sda -s 22 -a


I guess that "/sys/devices/platform/hdaps/position" is not yet ready, when hdapsd starts.

best regards
Comment 1 Tomasz Torcz 2012-10-22 08:53:21 EDT
Hi,

It seem to be problem in kernel - hdaps driver emits udev event before full initialization is complete and file is readable. You can probably workaroung is by sticking "ExecStartPre=/usr/bin/sleep 1" in unit file, but true fix should be done in kernel.

I cannot reproduce it (and I no longer have mechanical HDD in laptop). Would you please report it on the kernel list?
Comment 2 Stefan Jensen 2012-11-05 17:22:19 EST
Hi,

putting "sleep 1" in the unit file works fine for me. Thanks!
Will report it to the kernel list. Should we close this bug?

best regards
Comment 3 Tomasz Torcz 2012-11-06 01:47:23 EST
I won't include "sleep 1" in package unit file, though. So remember to add it again after upgrade. Shouldn't be much a problem, hdapsd is in all means finished software and I do not expect another release soon.

I will close this bug as it is kernel issue. Thanks for noticing, anyway.
Comment 4 Stefan Jensen 2012-11-10 12:53:56 EST
Reported to Kernel Bug Tracker: https://bugzilla.kernel.org/show_bug.cgi?id=50351

Sorry for the delay.

Note You need to log in before you can comment on or make changes to this bug.