Fix sanity checks and defaults file sourcing

This commit is contained in:
Erik Johnson 2013-09-13 12:48:50 -05:00
parent 8376fd5284
commit 186c929c51
3 changed files with 36 additions and 12 deletions

View file

@ -35,15 +35,23 @@ else
. /etc/rc.d/init.d/functions
fi
# Default values, can be overridden below in /etc/default/salt
SALTMASTER=/usr/bin/salt-master
PYTHON=/usr/bin/python
if [ -f /etc/default/salt ]; then
. /etc/default/salt
else
SALTMASTER=/usr/bin/salt-master
PYTHON=/usr/bin/python
fi
# Sanity checks.
[ -x $SALTMASTER ] || exit 0
if [ ! -x "$SALTMASTER" ]; then
echo "Unable to execute $SALTMASTER!"
exit 2
fi
if [ ! -x "$PYTHON" ]; then
echo "$PYTHON does not exist or is not executable"
exit 2
fi
SERVICE=salt-master
PROCESS=salt-master

View file

@ -36,15 +36,23 @@ else
. /etc/rc.d/init.d/functions
fi
# Default values, can be overridden below in /etc/default/salt
SALTMINION=/usr/bin/salt-minion
PYTHON=/usr/bin/python
if [ -f /etc/default/salt ]; then
. /etc/default/salt
else
SALTMINION=/usr/bin/salt-minion
PYTHON=/usr/bin/python
fi
# Sanity checks.
[ -x $SALTMINION ] || exit 0
if [ ! -x "$SALTMINION" ]; then
echo "Unable to execute $SALTMINION!"
exit 2
fi
if [ ! -x "$PYTHON" ]; then
echo "$PYTHON does not exist or is not executable"
exit 2
fi
SERVICE=salt-minion
PROCESS=salt-minion

View file

@ -36,15 +36,23 @@ else
. /etc/rc.d/init.d/functions
fi
# Default values, can be overridden below in /etc/default/salt
SALTSYNDIC=/usr/bin/salt-syndic
PYTHON=/usr/bin/python
if [ -f /etc/default/salt ]; then
. /etc/default/salt
else
SALTSYNDIC=/usr/bin/salt-syndic
PYTHON=/usr/bin/python
fi
# Sanity checks.
[ -x $SALTSYNDIC ] || exit 0
if [ ! -x "$SALTSYNDIC" ]; then
echo "Unable to execute $SALTSYNDIC!"
exit 2
fi
if [ ! -x "$PYTHON" ]; then
echo "$PYTHON does not exist or is not executable"
exit 2
fi
SERVICE=salt-syndic
PROCESS=salt-syndic