Do not use symlinks to enable selinux-autorelabel-mark.service

The service should be enabled using `systemd preset`
https://bugzilla.redhat.com/show_bug.cgi?id=1589720
This commit is contained in:
Petr Lautrbach 2018-06-07 19:32:22 +02:00
parent 3a5478fbe1
commit 7505971712
2 changed files with 9 additions and 5 deletions

View File

@ -162,15 +162,12 @@ rm -f %{buildroot}%{python2_sitelib}/sepolicy/gui.*
rm -f %{buildroot}%{python2_sitelib}/sepolicy/sepolicy.glade
rm -rf %{buildroot}%{python2_sitelib}/sepolicy/help
# https://bugzilla.redhat.com/show_bug.cgi?id=1328825
mkdir -m 755 -p %{buildroot}/%{_unitdir}/basic.target.wants/
mkdir -m 755 -p %{buildroot}/%{generatorsdir}
install -m 644 -p %{SOURCE16} %{buildroot}/%{_unitdir}/
install -m 644 -p %{SOURCE17} %{buildroot}/%{_unitdir}/
install -m 644 -p %{SOURCE18} %{buildroot}/%{_unitdir}/
install -m 755 -p %{SOURCE19} %{buildroot}/%{generatorsdir}/
install -m 755 -p %{SOURCE15} %{buildroot}/%{_libexecdir}/selinux/
ln -s ../selinux-autorelabel-mark.service %{buildroot}/%{_unitdir}/basic.target.wants/
# change /usr/bin/python3? to /usr/bin/python2 in policycoreutils-python/python2-policycoreutils
pathfix.py -i "%{__python2} -Es" -p %{buildroot}%{python2_sitelib}
@ -434,12 +431,10 @@ system-config-selinux is a utility for managing the SELinux environment
%{_libexecdir}/selinux/hll
%{_libexecdir}/selinux/selinux-autorelabel
%{_unitdir}/selinux-autorelabel-mark.service
%{_unitdir}/basic.target.wants/selinux-autorelabel-mark.service
%{_unitdir}/selinux-autorelabel.service
%{_unitdir}/selinux-autorelabel.target
%{generatorsdir}/selinux-autorelabel-generator.sh
%config(noreplace) %{_sysconfdir}/sestatus.conf
# selinux-policy Requires: policycoreutils, so we own this set of directories and our files within them
%{_mandir}/man5/selinux_config.5.gz
%{_mandir}/man5/sestatus.conf.5.gz
%{_mandir}/man8/fixfiles.8*
@ -490,6 +485,12 @@ The policycoreutils-restorecond package contains the restorecond service.
%{!?_licensedir:%global license %%doc}
%license policycoreutils-%{version}/COPYING
%post
%systemd_post selinux-autorelabel-mark.service
%preun
%systemd_preun selinux-autorelabel-mark.service
%post restorecond
%systemd_post restorecond.service

View File

@ -13,3 +13,6 @@ ConditionPathExists=!/.autorelabel
ExecStart=-/bin/touch /.autorelabel
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target