[packages] quagga: Fix ownership of configuration directory and files
authorVasilis Tsiligiannis <acinonyx@openwrt.gr>
Sun, 13 Mar 2011 21:00:10 +0000 (21:00 +0000)
committerVasilis Tsiligiannis <acinonyx@openwrt.gr>
Sun, 13 Mar 2011 21:00:10 +0000 (21:00 +0000)
SVN-Revision: 26151

net/quagga/files/quagga

index cf6855ce8573ef32ad353a488e1991de004a0522..0ccfb1cfe9d1b573d7cb168d6003d2c1d8941c86 100644 (file)
@@ -27,6 +27,8 @@ ARG_DAEMONS=$*
 BINDIR=/usr/sbin
 CONFDIR=/etc/quagga
 STATEDIR=/var/run/quagga
+RUNUSER=network
+RUNGROUP=$RUNUSER
 DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd"
 DAEMON_FLAGS=-d
 WATCHQUAGGA_FLAGS="-d -z -T 60 -R"
@@ -258,7 +260,7 @@ do
                then
                        if echo "${survivors}" > ${pidfile}
                        then
-                               chown quagga:quagga ${pidfile}
+                               chown ${RUNUSER}:${RUNGROUP} ${pidfile}
                                echo -n " Wrote ${survivors} to pidfile."
                        else
                                echo -n " Failed to write ${survivors} to pidfile."
@@ -274,10 +276,10 @@ if [ -n "$START_DAEMONS" ]
 then
        [ -d ${CONFDIR} ] \
        || quit "${ME}: no config directory ${CONFDIR} - exiting."
-       chown -R quagga:quagga ${CONFDIR}
+       chown -R ${RUNUSER}:${RUNGROUP} ${CONFDIR}
        [ -d ${STATEDIR} ] || mkdir -p ${STATEDIR} \
        || die "${ME}: could not create state directory ${STATEDIR} - exiting."
-       chown -R quagga:quagga ${STATEDIR}
+       chown -R ${RUNUSER}:${RUNGROUP} ${STATEDIR}
 
        for d in $START_DAEMONS
        do
@@ -300,7 +302,7 @@ then
                        then
                                if echo "${proc_pid}" > ${pidfile}
                                then
-                                       chown quagga:quagga ${pidfile}
+                                       chown ${RUNUSER}:${RUNGROUP} ${pidfile}
                                        echo -n " Wrote ${proc_pid} to pidfile."
                                else
                                        echo -n " Failed to write ${proc_pid} to pidfile."