Improve restorecond systemd unit file

Use Type=forking and pass PIDFile option, this allows better tracking of
the livecycle of the daemon.

Only attempt to start the daemon if selinux is enabled.

Drop After=syslog.target, syslog is socket activated anyway
This commit is contained in:
Laurent Bigonville 2013-11-06 13:24:00 +01:00 committed by Stephen Smalley
parent 28d63799d0
commit 1524e15303
1 changed files with 3 additions and 3 deletions

View File

@ -1,12 +1,12 @@
[Unit] [Unit]
Description=Restorecon maintaining path file context Description=Restorecon maintaining path file context
After=syslog.target
ConditionPathExists=/etc/selinux/restorecond.conf ConditionPathExists=/etc/selinux/restorecond.conf
ConditionSecurity=selinux
[Service] [Service]
Type=oneshot Type=forking
ExecStart=/usr/sbin/restorecond ExecStart=/usr/sbin/restorecond
RemainAfterExit=yes PIDFile=/var/run/restorecond.pid
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target