fix(scripts): run modprobe before starting Falco

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
This commit is contained in:
Leonardo Grasso
2020-08-25 11:24:12 +02:00
parent e0b66ecae9
commit 40635ab620
2 changed files with 4 additions and 4 deletions

View File

@@ -62,11 +62,11 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
if [ ! -d /sys/module/falco ]; then
/sbin/modprobe falco || exit 2
fi
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
if [ ! -d /sys/module/falco ]; then
/sbin/modprobe falco || exit 1
fi
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2

View File

@@ -52,10 +52,10 @@ start() {
[ -x $exec ] || exit 5
# [ -f $config ] || exit 6
echo -n $"Starting $prog: "
daemon $exec --daemon --pidfile=$pidfile
if [ ! -d /sys/module/falco ]; then
/sbin/modprobe falco || return $?
fi
daemon $exec --daemon --pidfile=$pidfile
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile