Bug 965177 - new version with systemd unit
new version with systemd unit
Product: Fedora
Classification: Fedora
Component: rtirq (Show other bugs)
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Brendan Jones
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-05-20 11:50 EDT by Simon Lewis
Modified: 2013-06-18 02:15 EDT (History)
3 users (show)

See Also:
Fixed In Version: rtirq-20130402-4.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-06-18 02:15:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Simon Lewis 2013-05-20 11:50:27 EDT
Please update to latest version...
# Download link: http://www.rncbc.org/jack/rtirq-20130402.tar.gz

I believe the following spec file extract will do the trick, but I am a user not a programmer so you will know a better way

%setup -q
sed -e "s|etc/sysconfig/rtirq|etc/conf.d/rtirq|" -i rtirq.sh
sed '/ExecStop/ a\
ExecReload=/etc/init.d/rtirq restart\
ExecStatus=/etc/init.d/rtirq status' -i rtirq.service
%patch0 -p0

# Nothing to do

%__rm -rf %{buildroot}
# Install rtirq files
install -vD rtirq.sh   -m 0755 %{buildroot}%{_sysconfdir}/init.d/rtirq.sh
install -vD rtirq.conf -m 0644 %{buildroot}%{_sysconfdir}/conf.d/rtirq.conf
install -vD rtirq.service -m 0644 %{buildroot}%{_sysconfdir}/systemd/system/rtirq.service
# Install udev and power files
install -D %{SOURCE1} -m 0755 %{buildroot}%{_bindir}/rtirq-udev
install -D %{SOURCE2} -m 0644 %{buildroot}%{_prefix}/lib/udev/rules.d/95-rtirq.rules
install -D %{SOURCE3} -m 0755 %{buildroot}%{_sysconfdir}/pm/sleep.d/05-rtirq

if [ -L /etc/rc5.d/S81rtirq ] ; then
   systemctl restart rtirq.service
   systemctl enable rtirq.service

systemctl disable rtirq.service

%__rm -rf %{buildroot}

# rtirq files
# udev and power management
Comment 1 Fedora Update System 2013-05-25 15:25:29 EDT
rtirq-20130402-1.fc19 has been submitted as an update for Fedora 19.
Comment 2 Fedora Update System 2013-05-25 15:25:39 EDT
rtirq-20130402-1.fc18 has been submitted as an update for Fedora 18.
Comment 3 Fedora Update System 2013-05-26 13:01:30 EDT
Package rtirq-20130402-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing rtirq-20130402-1.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 4 T.C. Hollingsworth 2013-06-04 15:28:18 EDT
You didn't do this quite right.

1. You need to get rid of the old sysv initscript competely (or ship it in a "-sysv" subpackage, but please don't do this).  You also need to enable the sysv->systemd conversion logic:


2. In Fedora 19, services should not enable themselves automatically, but instead use the new preset logic:

You may or may not need FESCo approval to start your service automatically:

If you are permitted to start your service automatically, file a bug against systemd to have it added to the distribution default preset file.
Comment 5 Brendan Jones 2013-06-08 01:48:22 EDT
Thanks for picking this up. I have just followed upstream in this case but I will modify as you've recommended. Updates have been unpushed
Comment 6 Brendan Jones 2013-06-13 00:57:29 EDT
Here's what I've got. We can enable by default in the audio spin kickstart - not required here

@@ -39,14 +39,11 @@ done
 rm -rf %{buildroot}
-install -D rtirq.sh   -m 0755 %{buildroot}%{_sysconfdir}/rc.d/init.d/rtirq
+install -D rtirq.sh   -m 0755 %{buildroot}%{_bindir}/rtirq
 install -D rtirq.conf -m 0644 %{buildroot}%{_sysconfdir}/sysconfig/rtirq
 # fix order of interrupts, tac was reversing the priority of the soundcards
-perl -p -i -e "s/\| tac//g" %{buildroot}%{_sysconfdir}/rc.d/init.d/rtirq
-# start rtirq after the alsasound startup script (starts at 87)
-perl -p -i -e "s|35 81 19|35 88 19|g" %{buildroot}%{_sysconfdir}/rc.d/init.d/rtirq
+perl -p -i -e "s/\| tac//g" %{buildroot}%{_bindir}/rtirq
 # high priority is 70 instead of 90 (in Fedora 17+)
 perl -p -i -e "s|RTIRQ_PRIO_HIGH=90|RTIRQ_PRIO_HIGH=70|g" %{buildroot}%{_sysconfdir}/sysconfig/rtirq
@@ -58,6 +55,8 @@ perl -p -i -e "s|RTIRQ_PRIO_DECR=5|RTIRQ
 perl -p -i -e "s|rtc snd usb i8042|rtc snd i8042|g" %{buildroot}%{_sysconfdir}/sysconfig/rtirq
 # adjust priority for udev changes, same as highest priority
 perl -p -i -e "s|RTIRQ_PRIO_UDEV=85|RTIRQ_PRIO_UDEV=70|g" %{buildroot}%{_sysconfdir}/sysconfig/rtirq
+# moved out of init.d/
+perl -p -i -e "s|/etc/init.d/|%{_bindir}/|g" rtirq.service
 # install udev and power files
 install -D %{SOURCE2} -m 0644 %{buildroot}%{_prefix}/lib/udev/rules.d/95-rtirq.rules
@@ -65,25 +64,7 @@ install -D %{SOURCE1} -m 0755 %{buildroo
 install -D %{SOURCE3} -m 0755 %{buildroot}%{_sysconfdir}/pm/sleep.d/05-rtirq
 install -vD rtirq.service -m 0644 %{buildroot}%{_prefix}/lib/systemd/system/rtirq.service
-# only run on install, not upgrade
-if [ "$1" = "1" ]; then
-    /sbin/chkconfig --add rtirq
-#   /sbin/chkconfig rtirq on
-if [ -L /etc/rc.d/rc5.d/S81rtirq ] ; then
-    # update startup to new priority
-    /sbin/chkconfig --del rtirq
-    /sbin/chkconfig --add rtirq
-systemctl enable rtirq.service
-# only run if this is the last instance to be removed
-if [ "$1" = "0" ]; then
-    /sbin/chkconfig rtirq off
-    /sbin/chkconfig --del rtirq
 systemctl disable rtirq.service
@@ -92,17 +73,23 @@ rm -rf %{buildroot}
 %config(noreplace) %{_sysconfdir}/sysconfig/rtirq
 # udev and power management
Comment 7 T.C. Hollingsworth 2013-06-13 03:38:47 EDT
That part looks good, you just need the new systemd scriptlets:
# This is actually needed for the %triggerun script but Requires(triggerun)
# is not valid.  We can use %post because this particular %triggerun script
# should fire just after this package is installed.
Requires(post): systemd-sysv


%systemd_post rtirq.service

%systemd_preun rtirq.service

%systemd_postun_with_restart rtirq.service 

%triggerun -- rtirq < 20130402
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply rtirq
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save rtirq >/dev/null 2>&1 ||:

# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del rtirq >/dev/null 2>&1 || :
/bin/systemctl try-restart rtirq.service >/dev/null 2>&1 || :


Then, if the Fedora Jam folks have moved over to the new preset logic [1] making rtirq start by default on that spin is as easy as adding a line to a file.

[1] http://www.freedesktop.org/wiki/Software/systemd/Preset/
Comment 8 Fedora Update System 2013-06-14 11:23:46 EDT
rtirq-20130402-4.fc19 has been submitted as an update for Fedora 19.
Comment 9 Fedora Update System 2013-06-18 02:15:16 EDT
rtirq-20130402-4.fc19 has been pushed to the Fedora 19 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.