Allow configuration of user:group through sysconfig

Resolves: rhbz#1344250
This commit is contained in:
Jaroslav Škarvada 2016-06-09 13:46:52 +02:00
parent 4627977151
commit ea3c76ef2a
4 changed files with 21 additions and 4 deletions

View File

@ -2,6 +2,14 @@
. /etc/sysconfig/network
# Source exim configureation.
if [ -f /etc/sysconfig/exim ] ; then
. /etc/sysconfig/exim
fi
USER=${USER:=exim}
GROUP=${GROUP:=exim}
gen_cert() {
if [ ! -f /etc/pki/tls/certs/exim.pem ] ; then
umask 077
@ -23,7 +31,7 @@ root@${FQDN}
EOF
if [ $? -eq 0 ]; then
echo success
chown exim.exim /etc/pki/tls/{private,certs}/exim.pem
chown $USER:$GROUP /etc/pki/tls/{private,certs}/exim.pem
chmod 600 /etc/pki/tls/{private,certs}/exim.pem
else
echo failure

View File

@ -23,6 +23,9 @@ else
QUEUE=1h
fi
USER=${USER:=exim}
GROUP=${GROUP:=exim}
gen_cert() {
if [ ! -f /etc/pki/tls/certs/exim.pem ] ; then
umask 077
@ -44,7 +47,7 @@ root@${FQDN}
EOF
if [ $? -eq 0 ]; then
success
chown exim.exim /etc/pki/tls/{private,certs}/exim.pem
chown $USER:$GROUP /etc/pki/tls/{private,certs}/exim.pem
chmod 600 /etc/pki/tls/{private,certs}/exim.pem
else
failure
@ -65,7 +68,7 @@ start() {
then
if [ "exim" != "`ls -l /var/log/exim/main.log | awk '{print $4}'`" ]
then
chown -R exim:exim /var/log/exim /var/spool/exim
chown -R $USER:$GROUP /var/log/exim /var/spool/exim
fi
fi

View File

@ -14,7 +14,7 @@
Summary: The exim mail transfer agent
Name: exim
Version: 4.87
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv2+
Url: http://www.exim.org/
Group: System Environment/Daemons
@ -585,6 +585,10 @@ test "$1" = 0 || %{_initrddir}/clamd.exim condrestart >/dev/null 2>&1 || :
%{_sysconfdir}/cron.daily/greylist-tidy.sh
%changelog
* Thu Jun 9 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 4.87-5
- Allow configuration of user:group through sysconfig
Resolves: rhbz#1344250
* Sat May 14 2016 Jitka Plesnikova <jplesnik@redhat.com> - 4.87-4
- Perl 5.24 rebuild

View File

@ -1,2 +1,4 @@
DAEMON=yes
QUEUE=1h
USER=exim
GROUP=exim