Fri, 21 Sep 2012 22:45:41 +0200
Avoid root permissions generally and allow for single daemon execution.
jabberd/jabberd.spec | file | annotate | diff | comparison | revisions | |
jabberd/rc.jabberd | file | annotate | diff | comparison | revisions |
1.1 --- a/jabberd/jabberd.spec Fri Sep 21 22:44:32 2012 +0200 1.2 +++ b/jabberd/jabberd.spec Fri Sep 21 22:45:41 2012 +0200 1.3 @@ -189,6 +189,7 @@ 1.4 %{l_make} %{l_mflags -O} 1.5 1.6 %if "%{with_mucon}" == "yes" 1.7 +#http://www.suramya.com/linux/tutorials/JabberSetup/ 1.8 loclibs='' 1.9 case "%{l_platform -t}" in 1.10 *-sunos* ) 1.11 @@ -250,9 +251,10 @@ 1.12 # determine installation files 1.13 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 1.14 %{l_files_std} \ 1.15 - '%config %{l_prefix}/etc/jabberd/*' \ 1.16 + '%config %attr(0640,%{l_mgrp},%{l_ngrp}) %{l_prefix}/etc/jabberd/*' \ 1.17 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \ 1.18 - '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*' 1.19 + '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*' \ 1.20 + '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*/*' 1.21 1.22 %files -f files 1.23
2.1 --- a/jabberd/rc.jabberd Fri Sep 21 22:44:32 2012 +0200 2.2 +++ b/jabberd/rc.jabberd Fri Sep 21 22:45:41 2012 +0200 2.3 @@ -16,12 +16,12 @@ 2.4 2.5 %common 2.6 jabberd_signal () { 2.7 - local retcode=0 2.8 + local retcode=1 2.9 local daemons= 2.10 for daemons in $jabberd_daemons; do 2.11 [ -f @l_prefix@/var/jabberd/pid/${daemons}.pid ] \ 2.12 - && kill -$1 `cat @l_prefix@/var/jabberd/pid/${daemons}.pid` 2.13 - retcode=$(($retcode+$?)) 2.14 + && kill -$1 `cat @l_prefix@/var/jabberd/pid/${daemons}.pid` \ 2.15 + && retcode=$? 2.16 done 2.17 return $retcode 2.18 } 2.19 @@ -56,7 +56,7 @@ 2.20 sleep 2 2.21 rc jabberd start 2.22 2.23 -%daily -u @l_susr@ 2.24 +%daily -u @l_nusr@ 2.25 rcService jabberd enable yes || exit 0 2.26 logfiles= 2.27 for daemons in $jabberd_daemons; do 2.28 @@ -64,7 +64,7 @@ 2.29 done 2.30 shtool rotate -f \ 2.31 -n ${jabberd_log_numfiles} -s ${jabberd_log_minsize} -d \ 2.32 - -z ${jabberd_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ 2.33 + -z ${jabberd_log_complevel} -m 644 -o @l_nusr@ -g @l_ngrp@ \ 2.34 -P "${jabberd_log_prolog}" \ 2.35 -E "${jabberd_log_epilog}; rc jabberd restart" \ 2.36 $logfiles