Skip to content

Commit dcf3171

Browse files
author
Qasim Sarfraz
committed
Fix for libnetwork service restartability
With this commit the directory for plumgrid libnetwork plugin will be recreated on system reboot and service restart Signed-off-by: Qasim Sarfraz <qasims@plumgrid.com>
1 parent b5cfad1 commit dcf3171

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packaging/init

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ NAME=libnetwork
1414

1515
PIDFILE=/var/run/$NAME.pid
1616
LOGFILE=/var/log/$NAME.log
17+
SOCKDIR=/var/run/docker/plugins
1718

1819
start() {
1920
if [ -f $PIDFILE ] && kill -0 $(cat $PIDFILE); then
2021
echo 'Service already running' >&2
2122
return 1
2223
fi
2324
echo 'Starting service…' >&2
25+
mkdir -p $SOCKDIR
2426
local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
2527
su -c "$CMD" $RUNAS > "$PIDFILE"
2628
echo 'Service started' >&2
@@ -42,7 +44,7 @@ status() {
4244
PID=$(cat $PIDFILE)
4345
if [ -z "$(ps axf | grep ${PID} | grep -v grep)" ]; then
4446
printf "%s\n" "The process appears to be dead but pidfile still exists"
45-
else
47+
else
4648
echo "Running, the PID is $PID"
4749
fi
4850
else

0 commit comments

Comments
 (0)