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 05:38:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 713562    
Attachments:
Description Flags
Native systemd service for hddtemp none

Description Jóhann B. Guðmundsson 2011-06-28 22:22:19 UTC
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 22:24:48 UTC
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 06:24:27 UTC
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 07:13:05 UTC
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 15:54:36 UTC
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 20:45:52 UTC
(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 21:05:38 UTC
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 15:26:49 UTC
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 05:38:45 UTC
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.