Skip to content

Commit bebcb2d

Browse files
authored
Merge pull request #136 from brdude/master
Fix debian inits scripts so they are usable at boot time.
2 parents e9bd6da + b8b5032 commit bebcb2d

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

support/docker-volume-netshare

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ set -e
1313

1414
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
1515

16-
BASE=$(basename $0)
16+
APP="docker-volume-netshare"
1717

18-
# modify these in /etc/default/$BASE (/etc/default/dkv-netshare)
19-
DKV_NETSHARE=/usr/bin/$BASE
18+
# modify these in /etc/default/$APP (/etc/default/dkv-netshare)
19+
DKV_NETSHARE=/usr/bin/$APP
2020
# This is the pid file created/managed by start-stop-daemon
21-
DKV_NETSHARE_SSD_PIDFILE=/var/run/$BASE-ssd.pid
22-
DKV_NETSHARE_LOGFILE=/var/log/$BASE.log
21+
DKV_NETSHARE_SSD_PIDFILE=/var/run/$APP-ssd.pid
22+
DKV_NETSHARE_LOGFILE=/var/log/$APP.log
2323
DKV_NETSHARE_OPTS=
2424
DKV_NETSHARE_DESC="Docker-Volume-Netshare"
2525

2626
# Get lsb functions
2727
. /lib/lsb/init-functions
2828

29-
if [ -f /etc/default/$BASE ]; then
30-
. /etc/default/$BASE
29+
if [ -f /etc/default/$APP ]; then
30+
. /etc/default/$APP
3131
fi
3232

3333
# Check docker is present
@@ -50,8 +50,8 @@ case "$1" in
5050
touch "$DKV_NETSHARE_LOGFILE"
5151
chgrp docker "$DKV_NETSHARE_LOGFILE"
5252

53-
54-
log_begin_msg "Starting $DKV_NETSHARE_DESC: $BASE"
53+
54+
log_begin_msg "Starting $DKV_NETSHARE_DESC: $APP"
5555
start-stop-daemon --start --background \
5656
--no-close \
5757
--exec "$DKV_NETSHARE" \
@@ -65,7 +65,7 @@ case "$1" in
6565

6666
stop)
6767
fail_unless_root
68-
log_begin_msg "Stopping $DKV_NETSHARE_DESC: $BASE"
68+
log_begin_msg "Stopping $DKV_NETSHARE_DESC: $APP"
6969
start-stop-daemon --stop --pidfile "$DKV_NETSHARE_SSD_PIDFILE"
7070
log_end_msg $?
7171
;;

support/sysvinit-debian/etc/init.d/docker-volume-netshare

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ set -e
1313

1414
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
1515

16-
BASE=$(basename $0)
16+
APP="docker-volume-netshare"
1717

18-
# modify these in /etc/default/$BASE (/etc/default/dkv-netshare)
19-
DKV_NETSHARE=/usr/bin/$BASE
18+
# modify these in /etc/default/$APP (/etc/default/dkv-netshare)
19+
DKV_NETSHARE=/usr/bin/$APP
2020
# This is the pid file created/managed by start-stop-daemon
21-
DKV_NETSHARE_SSD_PIDFILE=/var/run/$BASE-ssd.pid
22-
DKV_NETSHARE_LOGFILE=/var/log/$BASE.log
21+
DKV_NETSHARE_SSD_PIDFILE=/var/run/$APP-ssd.pid
22+
DKV_NETSHARE_LOGFILE=/var/log/$APP.log
2323
DKV_NETSHARE_OPTS=
2424
DKV_NETSHARE_DESC="Docker-Volume-Netshare"
2525

2626
# Get lsb functions
2727
. /lib/lsb/init-functions
2828

29-
if [ -f /etc/default/$BASE ]; then
30-
. /etc/default/$BASE
29+
if [ -f /etc/default/$APP ]; then
30+
. /etc/default/$APP
3131
fi
3232

3333
# Check docker is present
@@ -50,8 +50,8 @@ case "$1" in
5050
touch "$DKV_NETSHARE_LOGFILE"
5151
chgrp docker "$DKV_NETSHARE_LOGFILE"
5252

53-
54-
log_begin_msg "Starting $DKV_NETSHARE_DESC: $BASE"
53+
54+
log_begin_msg "Starting $DKV_NETSHARE_DESC: $APP"
5555
start-stop-daemon --start --background \
5656
--no-close \
5757
--exec "$DKV_NETSHARE" \
@@ -65,7 +65,7 @@ case "$1" in
6565

6666
stop)
6767
fail_unless_root
68-
log_begin_msg "Stopping $DKV_NETSHARE_DESC: $BASE"
68+
log_begin_msg "Stopping $DKV_NETSHARE_DESC: $APP"
6969
start-stop-daemon --stop --pidfile "$DKV_NETSHARE_SSD_PIDFILE"
7070
log_end_msg $?
7171
;;

0 commit comments

Comments
 (0)