aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initscripts.spec13
-rw-r--r--usr/lib/systemd/system/netconsole.service14
-rwxr-xr-xusr/libexec/netconsole (renamed from etc/rc.d/init.d/netconsole)0
3 files changed, 22 insertions, 5 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 0435b990..dbfe14bd 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -238,12 +238,13 @@ fi
# ---------------
%post -n netconsole-service
-chkconfig --add netconsole > /dev/null 2>&1 || :
+%systemd_post netconsole.service
%preun -n netconsole-service
-if [ $1 -eq 0 ]; then
- chkconfig --del netconsole > /dev/null 2>&1 || :
-fi
+%systemd_preun netconsole.service
+
+%postun -n netconsole-service
+%systemd_postun netconsole.service
# ---------------
@@ -323,9 +324,11 @@ fi
# ---------------
%files -n netconsole-service
-%{_sysconfdir}/rc.d/init.d/netconsole
%config(noreplace) %{_sysconfdir}/sysconfig/netconsole
+%{_libexecdir}/netconsole
+%{_prefix}/lib/systemd/system/netconsole.service
+
# ---------------
%files -n readonly-root
diff --git a/usr/lib/systemd/system/netconsole.service b/usr/lib/systemd/system/netconsole.service
new file mode 100644
index 00000000..29248a4f
--- /dev/null
+++ b/usr/lib/systemd/system/netconsole.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Initializes network console logging of kernel messages
+ConditionPathExists=/etc/sysconfig/netconsole
+After=network-online.target
+Wants=network-online.target
+
+[Service]
+ExecStart=/usr/libexec/netconsole start
+ExecStop=/usr/libexec/netconsole stop
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/etc/rc.d/init.d/netconsole b/usr/libexec/netconsole
index 3f2872dd..3f2872dd 100755
--- a/etc/rc.d/init.d/netconsole
+++ b/usr/libexec/netconsole