首页 技术 正文
技术 2022年11月16日
0 收藏 574 点赞 5,012 浏览 3493 个字
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#
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,494
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295