[packages] quagga: Fix ownership of configuration directory and files
git-svn-id: svn+ssh://svn.openwrt.org/openwrt@26151 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
fc7fc943bc
commit
7a5d81f357
1 changed files with 6 additions and 4 deletions
10
files/quagga
10
files/quagga
|
@ -27,6 +27,8 @@ ARG_DAEMONS=$*
|
||||||
BINDIR=/usr/sbin
|
BINDIR=/usr/sbin
|
||||||
CONFDIR=/etc/quagga
|
CONFDIR=/etc/quagga
|
||||||
STATEDIR=/var/run/quagga
|
STATEDIR=/var/run/quagga
|
||||||
|
RUNUSER=network
|
||||||
|
RUNGROUP=$RUNUSER
|
||||||
DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd"
|
DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd"
|
||||||
DAEMON_FLAGS=-d
|
DAEMON_FLAGS=-d
|
||||||
WATCHQUAGGA_FLAGS="-d -z -T 60 -R"
|
WATCHQUAGGA_FLAGS="-d -z -T 60 -R"
|
||||||
|
@ -258,7 +260,7 @@ do
|
||||||
then
|
then
|
||||||
if echo "${survivors}" > ${pidfile}
|
if echo "${survivors}" > ${pidfile}
|
||||||
then
|
then
|
||||||
chown quagga:quagga ${pidfile}
|
chown ${RUNUSER}:${RUNGROUP} ${pidfile}
|
||||||
echo -n " Wrote ${survivors} to pidfile."
|
echo -n " Wrote ${survivors} to pidfile."
|
||||||
else
|
else
|
||||||
echo -n " Failed to write ${survivors} to pidfile."
|
echo -n " Failed to write ${survivors} to pidfile."
|
||||||
|
@ -274,10 +276,10 @@ if [ -n "$START_DAEMONS" ]
|
||||||
then
|
then
|
||||||
[ -d ${CONFDIR} ] \
|
[ -d ${CONFDIR} ] \
|
||||||
|| quit "${ME}: no config directory ${CONFDIR} - exiting."
|
|| quit "${ME}: no config directory ${CONFDIR} - exiting."
|
||||||
chown -R quagga:quagga ${CONFDIR}
|
chown -R ${RUNUSER}:${RUNGROUP} ${CONFDIR}
|
||||||
[ -d ${STATEDIR} ] || mkdir -p ${STATEDIR} \
|
[ -d ${STATEDIR} ] || mkdir -p ${STATEDIR} \
|
||||||
|| die "${ME}: could not create state directory ${STATEDIR} - exiting."
|
|| die "${ME}: could not create state directory ${STATEDIR} - exiting."
|
||||||
chown -R quagga:quagga ${STATEDIR}
|
chown -R ${RUNUSER}:${RUNGROUP} ${STATEDIR}
|
||||||
|
|
||||||
for d in $START_DAEMONS
|
for d in $START_DAEMONS
|
||||||
do
|
do
|
||||||
|
@ -300,7 +302,7 @@ then
|
||||||
then
|
then
|
||||||
if echo "${proc_pid}" > ${pidfile}
|
if echo "${proc_pid}" > ${pidfile}
|
||||||
then
|
then
|
||||||
chown quagga:quagga ${pidfile}
|
chown ${RUNUSER}:${RUNGROUP} ${pidfile}
|
||||||
echo -n " Wrote ${proc_pid} to pidfile."
|
echo -n " Wrote ${proc_pid} to pidfile."
|
||||||
else
|
else
|
||||||
echo -n " Failed to write ${proc_pid} to pidfile."
|
echo -n " Failed to write ${proc_pid} to pidfile."
|
||||||
|
|
Loading…
Reference in a new issue