Merge pull request #107 from gsomlo/distro_quagga

daemon: start Quagga with default user/group names
This commit is contained in:
Jeff Ahrenholz 2017-02-23 08:30:55 -08:00 committed by GitHub
commit c616699d77

View file

@ -20,11 +20,6 @@ from core.misc.ipaddr import IPv4Prefix, isIPv4Address, isIPv6Address
from core.api import coreapi from core.api import coreapi
from core.constants import * from core.constants import *
QUAGGA_USER="root"
QUAGGA_GROUP="root"
if os.uname()[0] == "FreeBSD":
QUAGGA_GROUP="wheel"
class Zebra(CoreService): class Zebra(CoreService):
''' '''
''' '''
@ -139,8 +134,6 @@ QUAGGA_CONF=%s
QUAGGA_SBIN_SEARCH=%s QUAGGA_SBIN_SEARCH=%s
QUAGGA_BIN_SEARCH=%s QUAGGA_BIN_SEARCH=%s
QUAGGA_STATE_DIR=%s QUAGGA_STATE_DIR=%s
QUAGGA_USER=%s
QUAGGA_GROUP=%s
searchforprog() searchforprog()
{ {
@ -185,7 +178,7 @@ bootdaemon()
flags="$flags -6" flags="$flags -6"
fi fi
$QUAGGA_SBIN_DIR/$1 $flags -u $QUAGGA_USER -g $QUAGGA_GROUP -d $QUAGGA_SBIN_DIR/$1 $flags -d
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
echo "ERROR: Quagga's '$1' daemon failed to start!:" echo "ERROR: Quagga's '$1' daemon failed to start!:"
return 1 return 1
@ -222,7 +215,7 @@ fi
confcheck confcheck
bootquagga bootquagga
""" % (cls._configs[0], quagga_sbin_search, quagga_bin_search, \ """ % (cls._configs[0], quagga_sbin_search, quagga_bin_search, \
QUAGGA_STATE_DIR, QUAGGA_USER, QUAGGA_GROUP) QUAGGA_STATE_DIR)
addservice(Zebra) addservice(Zebra)