From 53ccfb3b4d86304d7e808dcbbdd3c5b40ec75a03 Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Wed, 9 Oct 2013 17:36:36 -0400 Subject: [PATCH] Add support for systemd service for restorecond --- policycoreutils/restorecond/Makefile | 6 ++++-- policycoreutils/restorecond/restorecond.service | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 policycoreutils/restorecond/restorecond.service diff --git a/policycoreutils/restorecond/Makefile b/policycoreutils/restorecond/Makefile index 30745426..f99e1e70 100644 --- a/policycoreutils/restorecond/Makefile +++ b/policycoreutils/restorecond/Makefile @@ -5,9 +5,10 @@ LIBDIR ?= $(PREFIX)/lib MANDIR = $(PREFIX)/share/man AUTOSTARTDIR = $(DESTDIR)/etc/xdg/autostart DBUSSERVICEDIR = $(DESTDIR)/usr/share/dbus-1/services +SYSTEMDDIR ?= $(DESTDIR)/usr/lib/systemd autostart_DATA = sealertauto.desktop -INITDIR = $(DESTDIR)/etc/rc.d/init.d +INITDIR ?= $(DESTDIR)/etc/rc.d/init.d SELINUXDIR = $(DESTDIR)/etc/selinux DBUSFLAGS = -DHAVE_DBUS -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/lib/dbus-1.0/include @@ -39,7 +40,8 @@ install: all install -m 644 restorecond.desktop $(AUTOSTARTDIR)/restorecond.desktop -mkdir -p $(DBUSSERVICEDIR) install -m 600 org.selinux.Restorecond.service $(DBUSSERVICEDIR)/org.selinux.Restorecond.service - + -mkdir -p $(SYSTEMDDIR)/system + install -m 644 restorecond.service $(SYSTEMDDIR)/system/ relabel: install /sbin/restorecon $(SBINDIR)/restorecond diff --git a/policycoreutils/restorecond/restorecond.service b/policycoreutils/restorecond/restorecond.service new file mode 100644 index 00000000..7d64cc5a --- /dev/null +++ b/policycoreutils/restorecond/restorecond.service @@ -0,0 +1,12 @@ +[Unit] +Description=Restorecon maintaining path file context +After=syslog.target +ConditionPathExists=/etc/selinux/restorecond.conf + +[Service] +Type=oneshot +ExecStart=/usr/sbin/restorecond +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target