Bug 717479

Summary: Provide native systemd unit file
Product: [Fedora] Fedora Reporter: Jóhann B. Guðmundsson <johannbg>
Component: hddtempAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hddtemp-0.3-0.22.beta15.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-28 01:38:50 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 713562    
Attachments:
Description Flags
Native systemd service for hddtemp none

Description Jóhann B. Guðmundsson 2011-06-28 18:22:19 EDT
Description of problem:
https://fedoraproject.org/wiki/Features/SysVtoSystemd


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Jóhann B. Guðmundsson 2011-06-28 18:24:48 EDT
Created attachment 510371 [details]
Native systemd service for hddtemp

note this service files only deals with /dev/sd* devices you might want to take a look at ( man ) systemd.device to see if this can be done more elegantly
Comment 2 Ville Skyttä 2011-06-29 02:24:27 EDT
I don't think that'll work because systemd does not expand globs, see bug 710055.

Here's what I've come up with so far, the only thing left being handling the disks for which to start the service for:


[Unit]
Description=Hard drive temperature monitor daemon
After=syslog.target

[Service]
EnvironmentFile=/etc/sysconfig/hddtemp
ExecStart=/usr/sbin/hddtemp -dF $HDDTEMP_OPTIONS

[Install]
WantedBy=multi-user.target
Comment 3 Jóhann B. Guðmundsson 2011-06-29 03:13:05 EDT
Hum....

Could you drop tiny script snippet that generates the list of disk at startup and dumps that list under DISKS= variable in /etc/sysconfig/hddtemp which you then could call in the native systemd service file which in turn would be something like.. 

[Unit]
Description=Hard drive temperature monitor daemon
After=syslog.target

[Service]
EnvironmentFile=-/etc/sysconfig/hddtemp
ExecStartPre=-/usr/libexec/<script snippet>
ExecStart=/usr/sbin/hddtemp -dF $HDDTEMP_OPTIONS $DISKS

[Install]
WantedBy=multi-user.target
Comment 4 Ville Skyttä 2011-06-29 11:54:36 EDT
Yes, something like that is what I've considered, but instead of doing that in the unit file, I've for now thought about doing that in the package's scriptlets as it doesn't IMO need to be run more than once.  But then again, doing it in package scriptlets may cause problems on fresh setups, so in that sense doing it at service startup might be a better option.

Another option I'm considering is patching hddtemp to expand globs itself if systemd doesn't gain that ability and/or looking for something like /dev/[hs]d[a-z] by default if no disks are passed as arguments.
Comment 5 Ville Skyttä 2011-08-18 16:45:52 EDT
(In reply to comment #4)
> looking for something like
> /dev/[hs]d[a-z] by default if no disks are passed as arguments.

I took this (ugly but functional) approach in 0.3-0.22.beta15.
Comment 6 Fedora Update System 2011-08-18 17:05:38 EDT
hddtemp-0.3-0.22.beta15.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/hddtemp-0.3-0.22.beta15.fc16
Comment 7 Fedora Update System 2011-08-19 11:26:49 EDT
Package hddtemp-0.3-0.22.beta15.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing hddtemp-0.3-0.22.beta15.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/hddtemp-0.3-0.22.beta15.fc16
then log in and leave karma (feedback).
Comment 8 Fedora Update System 2011-08-28 01:38:45 EDT
hddtemp-0.3-0.22.beta15.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.