use tabs for indentation

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2016-07-12 23:16:55 +02:00
parent 534c3e328f
commit fa077f7496
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 89 additions and 89 deletions

View File

@ -45,11 +45,11 @@ if [ ! -x $DOCKERD ]; then
fi fi
check_init() { check_init() {
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it directly) # see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it directly)
if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; then if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; then
log_failure_msg "$DOCKER_DESC is managed via upstart, try using service $BASE $1" log_failure_msg "$DOCKER_DESC is managed via upstart, try using service $BASE $1"
exit 1 exit 1
fi fi
} }
fail_unless_root() { fail_unless_root() {

View File

@ -32,122 +32,122 @@ logfile="/var/log/$prog"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
prestart() { prestart() {
service cgconfig status > /dev/null service cgconfig status > /dev/null
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
service cgconfig start service cgconfig start
fi fi
} }
start() { start() {
if [ ! -x $exec ]; then if [ ! -x $exec ]; then
if [ ! -e $exec ]; then if [ ! -e $exec ]; then
echo "Docker executable $exec not found" echo "Docker executable $exec not found"
else else
echo "You do not have permission to execute the Docker executable $exec" echo "You do not have permission to execute the Docker executable $exec"
fi fi
exit 5 exit 5
fi fi
check_for_cleanup check_for_cleanup
if ! [ -f $pidfile ]; then if ! [ -f $pidfile ]; then
prestart prestart
printf "Starting $prog:\t" printf "Starting $prog:\t"
echo "\n$(date)\n" >> $logfile echo "\n$(date)\n" >> $logfile
"$unshare" -m -- $exec $other_args >> $logfile 2>&1 & "$unshare" -m -- $exec $other_args >> $logfile 2>&1 &
pid=$! pid=$!
touch $lockfile touch $lockfile
# wait up to 10 seconds for the pidfile to exist. see # wait up to 10 seconds for the pidfile to exist. see
# https://github.com/docker/docker/issues/5359 # https://github.com/docker/docker/issues/5359
tries=0 tries=0
while [ ! -f $pidfile -a $tries -lt 10 ]; do while [ ! -f $pidfile -a $tries -lt 10 ]; do
sleep 1 sleep 1
tries=$((tries + 1)) tries=$((tries + 1))
echo -n '.' echo -n '.'
done done
if [ ! -f $pidfile ]; then if [ ! -f $pidfile ]; then
failure failure
echo echo
exit 1 exit 1
fi fi
success success
echo echo
else else
failure failure
echo echo
printf "$pidfile still exists...\n" printf "$pidfile still exists...\n"
exit 7 exit 7
fi fi
} }
stop() { stop() {
echo -n $"Stopping $prog: " echo -n $"Stopping $prog: "
killproc -p $pidfile -d 300 $prog killproc -p $pidfile -d 300 $prog
retval=$? retval=$?
echo echo
[ $retval -eq 0 ] && rm -f $lockfile [ $retval -eq 0 ] && rm -f $lockfile
return $retval return $retval
} }
restart() { restart() {
stop stop
start start
} }
reload() { reload() {
restart restart
} }
force_reload() { force_reload() {
restart restart
} }
rh_status() { rh_status() {
status -p $pidfile $prog status -p $pidfile $prog
} }
rh_status_q() { rh_status_q() {
rh_status >/dev/null 2>&1 rh_status >/dev/null 2>&1
} }
check_for_cleanup() { check_for_cleanup() {
if [ -f ${pidfile} ]; then if [ -f ${pidfile} ]; then
/bin/ps -fp $(cat ${pidfile}) > /dev/null || rm ${pidfile} /bin/ps -fp $(cat ${pidfile}) > /dev/null || rm ${pidfile}
fi fi
} }
case "$1" in case "$1" in
start) start)
rh_status_q && exit 0 rh_status_q && exit 0
$1 $1
;; ;;
stop) stop)
rh_status_q || exit 0 rh_status_q || exit 0
$1 $1
;; ;;
restart) restart)
$1 $1
;; ;;
reload) reload)
rh_status_q || exit 7 rh_status_q || exit 7
$1 $1
;; ;;
force-reload) force-reload)
force_reload force_reload
;; ;;
status) status)
rh_status rh_status
;; ;;
condrestart|try-restart) condrestart|try-restart)
rh_status_q || exit 0 rh_status_q || exit 0
restart restart
;; ;;
*) *)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2 exit 2
esac esac
exit $? exit $?