daemon: start Quagga with default user/group names
Allow native distribution packages to run with their default user and group names by no longer forcing "-u root -g root" on any of the Quagga daemons' command lines. This should continue to allow hand-compiled and/or "side-loaded" Quagga software to run as root, if configured to do so at build time. Signed-off-by: Gabriel Somlo <glsomlo@cert.org>
This commit is contained in:
parent
3e208ab4b7
commit
b1ea0574e5
1 changed files with 2 additions and 9 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue