Bug 717479 - Provide native systemd unit file
Summary: Provide native systemd unit file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: hddtemp
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: SysVtoSystemd
TreeView+ depends on / blocked
 
Reported: 2011-06-28 22:22 UTC by Jóhann B. Guðmundsson
Modified: 2011-08-28 05:38 UTC (History)
1 user (show)

Fixed In Version: hddtemp-0.3-0.22.beta15.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-28 05:38:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Native systemd service for hddtemp (272 bytes, text/plain)
2011-06-28 22:24 UTC, Jóhann B. Guðmundsson
no flags Details

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.


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