Fix setsebool log message with selinux disabled

This is cosmetic fix, that's prevent execution of setsebool
during ypbind service start when selinux is disabled.

As a result invalid boolean message should not occur in logs anymore:

systemd[1]: Starting NIS/YP (Network Information Service) Clients to NIS Domain Binder...
setsebool[1581714]: Could not change active booleans: Invalid boolean

Resolves: #1882069
This commit is contained in:
Marek Kulik 2021-09-27 11:43:51 +02:00
parent 0f165ba4e8
commit dd659bf840
2 changed files with 5 additions and 2 deletions

View File

@ -13,7 +13,7 @@ NotifyAccess=all
EnvironmentFile=-/etc/sysconfig/network
EnvironmentFile=-/etc/sysconfig/ypbind
ExecStartPre=/usr/libexec/ypbind-pre-setdomain
ExecStartPre=-/usr/sbin/setsebool allow_ypbind=1
ExecStartPre=-/bin/bash -c 'selinuxenabled && /usr/sbin/setsebool allow_ypbind=1'
ExecStart=/usr/sbin/ypbind -n $OTHER_YPBIND_OPTS
ExecStartPost=/usr/libexec/ypbind-post-waitbind
PrivateTmp=true

View File

@ -2,7 +2,7 @@ Summary: The NIS daemon which binds NIS clients to an NIS domain
Name: ypbind
Epoch: 3
Version: 2.7.2
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv2
Source0: https://github.com/thkukuk/ypbind-mt/archive/v%{version}.tar.gz#/ypbind-mt-%{version}.tar.gz
Url: http://www.linux-nis.org/nis/ypbind-mt/index.html
@ -109,6 +109,9 @@ install -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/ypbind-post-waitbind
%license COPYING
%changelog
* Tue Sep 28 2021 Marek Kulik <mkulik@redhat.com> - 3:2.7.2-6
- Fix setsebool message in logs, resolves: #1882069
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3:2.7.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild