root@ubuntu:/etc/init.d# ll
total
drwxr-xr-x root root May : ./
drwxr-xr-x root root May : ../
-rwxr-xr-x root root Oct apparmor*
-rwxr-xr-x root root Jan bootmisc.sh*
-rwxr-xr-x root root Jan checkfs.sh*
-rwxr-xr-x root root Jan checkroot-bootclean.sh*
-rwxr-xr-x root root Jan checkroot.sh*
-rwxr-xr-x root root Apr console-setup*
-rwxr-xr-x root root Apr cron*
-rwxr-xr-x root root Dec dbus*
-rw-r--r-- root root May : .depend.boot
-rw-r--r-- root root May : .depend.start
-rw-r--r-- root root May : .depend.stop
-rwxr-xr-x root root Mar grub-common*
-rwxr-xr-x root root Jan halt*
-rwxr-xr-x root root Jan hostname.sh*
-rwxr-xr-x root root Mar hwclock.sh*
-rwxr-xr-x root root Apr irqbalance*
-rwxr-xr-x root root Apr keyboard-setup*
-rwxr-xr-x root root Jan killprocs*
-rwxr-xr-x root root Dec kmod*
-rwxr-xr-x root root Jun mongodb*
-rwxr-xr-x root root Jan mountall-bootclean.sh*
-rwxr-xr-x root root Jan mountall.sh*
-rwxr-xr-x root root Jan mountdevsubfs.sh*
-rwxr-xr-x root root Jan mountkernfs.sh*
-rwxr-xr-x root root Jan mountnfs-bootclean.sh*
-rwxr-xr-x root root Jan mountnfs.sh*
-rwxr-xr-x root root Jul networking*
-rwxr-xr-x root root Oct ondemand*
-rwxr-xr-x root root Mar : php7.-fpm*
-rwxr-xr-x root root Nov plymouth*
-rwxr-xr-x root root Nov plymouth-log*
-rwxr-xr-x root root Sep procps*
-rwxr-xr-x root root Jan rc*
-rwxr-xr-x root root Jan rc.local*
-rwxr-xr-x root root Jan rcS*
-rw-r--r-- root root Jan README
-rwxr-xr-x root root Jan reboot*
-rwxr-xr-x root root Dec redis-server*
-rwxr-xr-x root root Nov resolvconf*
-rwxr-xr-x root root Jul rsync*
-rwxr-xr-x root root Feb rsyslog*
-rwxr-xr-x root root Jan sendsigs*
-rwxr-xr-x root root Jan single*
-rw-r--r-- root root Jan skeleton
-rwxr-xr-x root root Apr ssh*
-rwxr-xr-x root root Apr udev*
-rwxr-xr-x root root Aug ufw*
-rwxr-xr-x root root Jan umountfs*
-rwxr-xr-x root root Jan umountnfs.sh*
-rwxr-xr-x root root Jan umountroot*
-rwxr-xr-x root root Jan urandom*
-rwxr-xr-x root root Dec : uuidd*
root@ubuntu:/etc/init.d# cat redis-server
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start:
# Default-Stop:
# Short-Description: redis-server - Persistent key-value db
# Description: redis-server - Persistent key-value db
### END INIT INFOPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/redis-server
DAEMON_ARGS=/etc/redis/redis.conf
NAME=redis-server
DESC=redis-serverRUNDIR=/var/run/redis
PIDFILE=$RUNDIR/redis-server.pidtest -x $DAEMON || exit if [ -r /etc/default/$NAME ]
then
. /etc/default/$NAME
fi. /lib/lsb/init-functionsset -eRun_parts () {
if [ -d /etc/redis/${NAME}.${}.d ]
then
su redis -s /bin/sh -c "run-parts --exit-on-error /etc/redis/${NAME}.${1}.d"
fi
}case "$1" in
start)
echo -n "Starting $DESC: "
mkdir -p $RUNDIR
touch $PIDFILE
chown redis:redis $RUNDIR $PIDFILE
chmod $RUNDIR if [ -n "$ULIMIT" ]
then
ulimit -n $ULIMIT
fi Run_parts pre-up if start-stop-daemon --start --quiet --oknodo --umask --pidfile $PIDFILE --chuid redis:redis --exec $DAEMON -- $DAEMON_ARGS
then
Run_parts post-up
echo "$NAME."
else
echo "failed"
fi
;;
stop)
echo -n "Stopping $DESC: " Run_parts pre-down if start-stop-daemon --stop --retry forever/TERM/ --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
then
Run_parts post-down
echo "$NAME."
else
echo "failed"
fi
rm -f $PIDFILE
sleep
;; restart|force-reload)
${} stop
${} start
;; status)
status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME}
;; *)
echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&
exit
;;
esacexit
root@ubuntu:/etc/init.d# redis-server stop
:C May ::19.728 # Fatal error, can't open config file 'stop'
root@ubuntu:/etc/init.d# ./redis-server stop
[ ok ] Stopping redis-server (via systemctl): redis-server.service.
root@ubuntu:/etc/init.d# ./redis-server start
[ ok ] Starting redis-server (via systemctl): redis-server.service.
root@ubuntu:/etc/init.d#