wok-current view docker-official/stuff/daemon @ rev 25788
Mass update to fix build with gcc10 and up others packages
| author | Stanislas Leduc <shann@slitaz.org> |
|---|---|
| date | Tue Sep 30 07:43:04 2025 +0000 (3 weeks ago) |
| parents | |
| children |
line source
1 #!/bin/sh
2 # /etc/init.d/dockerd: Start, stop and restart dockerd on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
7 . /etc/daemons.conf
9 NAME=dockerd
10 DESC="$(_ 'Docker')"
11 DAEMON=/usr/bin/dockerd
12 OPTIONS=$DOCKERD_OPTIONS
13 PIDFILE=/run/dockerd.pid
14 LOGFILE=/var/log/dockerd.log
16 if ! grep -q ^cgroup /etc/mtab; then
17 mount -t cgroup cgroup /sys/fs/cgroup
18 echo 1 > /sys/fs/cgroup/memory.use_hierarchy
19 fi
21 if ! grep -q ^br_netfilter /proc/modules; then
22 modprobe br_netfilter
23 fi
25 case "$1" in
26 start)
27 if active_pidfile $PIDFILE dockerd ; then
28 _ '%s is already running.' $NAME
29 exit 1
30 fi
31 action 'Starting %s: %s...' "$DESC" $NAME
32 $DAEMON $OPTIONS -p $PIDFILE >> $LOGFILE 2>&1 &
33 status
34 ;;
35 stop)
36 if ! active_pidfile $PIDFILE dockerd ; then
37 _ '%s is not running.' $NAME
38 exit 1
39 fi
40 action 'Stopping %s: %s...' "$DESC" $NAME
41 kill $(cat $PIDFILE)
42 rm $PIDFILE
43 status
44 ;;
45 restart)
46 if ! active_pidfile $PIDFILE dockerd ; then
47 _ '%s is not running.' $NAME
48 exit 1
49 fi
50 action 'Restarting %s: %s...' "$DESC" $NAME
51 kill $(cat $PIDFILE)
52 rm $PIDFILE
53 sleep 2
54 $DAEMON $OPTIONS -p $PIDFILE >> $LOGFILE 2>&1 &
55 status
56 ;;
57 *)
58 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
59 newline
60 exit 1
61 ;;
62 esac
64 exit 0