-
Notifications
You must be signed in to change notification settings - Fork 47
/
S60dockerd
executable file
·48 lines (37 loc) · 888 Bytes
/
S60dockerd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
PROG=/usr/bin/dockerd
LOG=/var/log/dockerd.log
test -x ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
function start() {
msg_begin "Starting docker engine"
mkdir -p /data/docker
ln -sf /data/docker /var/lib/docker
mkdir -p /var/run/docker
test -f /var/lib/docker/daemon.json || echo '{}' > /var/lib/docker/daemon.json
modprobe fuse &>/dev/null
${PROG} -H unix:///var/run/docker.sock -G root > ${LOG} 2>&1 &
test $? == 0 && msg_done || msg_fail
}
function stop() {
msg_begin "Stopping docker engine"
killall -q $(basename ${PROG})
test $? == 0 && msg_done || msg_fail
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit $?