/etc/init.d/docker-registry is in docker-registry 2.6.2~ds1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | #!/bin/sh
set -e
### BEGIN INIT INFO
# Provides: docker-registry
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: the Docker toolset to pack, ship, store, and deliver content
### END INIT INFO
BASE=docker-registry
BINARY=/usr/bin/$BASE
CONFIG=/etc/docker/registry/config.yml
EXECUSER=docker-registry
PIDFILE=/var/run/$BASE.pid
LOGFILE=/var/log/$BASE.log
DESC="$BASE"
. /lib/lsb/init-functions
if [ -f /etc/default/$BASE ]; then
. /etc/default/$BASE
fi
if init_is_upstart; then
log_failure_msg "$BASE is managed via upstart, try using service $BASE $1"
exit 1
fi
if [ ! -x "$BINARY" ]; then
log_failure_msg "$BINARY not present or not executable"
exit 1
fi
fail_unless_root() {
if [ "$(id -u)" != '0' ]; then
log_failure_msg "$DESC must be run as root"
exit 1
fi
}
case "$1" in
start)
fail_unless_root
log_begin_msg "Starting $DESC"
start-stop-daemon --start --background \
--no-close \
--chuid "$EXECUSER" \
--exec "$BINARY" \
--pidfile "$PIDFILE" \
--make-pidfile \
-- serve "$CONFIG" \
>> "$LOGFILE" 2>&1
log_end_msg $?
;;
stop)
fail_unless_root
log_begin_msg "Stopping $DESC"
start-stop-daemon --stop --pidfile "$PIDFILE"
log_end_msg $?
;;
restart|force-reload)
fail_unless_root
$0 stop
$0 start
;;
status)
status_of_proc -p "$PIDFILE" "$BINARY" "$DESC"
;;
*)
echo "usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
|