Skip to content

Commit de024c0

Browse files
author
Fawad Khaliq
authored
Merge pull request #48 from plumgrid/qasims-dev
Fix for libnetwork service restartability
2 parents d0cd345 + dcf3171 commit de024c0

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)