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 INFO PATH=/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-server RUNDIR=/var/run/redis
PIDFILE=$RUNDIR/redis-server.pid test -x $DAEMON || exit if [ -r /etc/default/$NAME ]
then
. /etc/default/$NAME
fi . /lib/lsb/init-functions set -e Run_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
;;
esac exit
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#

/etc/init.d# ./redis-server start的更多相关文章

  1. 虚拟机centOS中安装Redis,主机Redis Destop Manager不能访问虚拟机Redis server的解决方案

    今天在学些redis的时候碰到个问题,发现主机Redis Destop Manager不能访问虚拟机Redis server的解决方案,找了一些网上的资料,原因可能有两个,整理记录下来: 1. Red ...

  2. C# Redis Server分布式缓存编程 --网络转载

    这篇文章我将介绍如果用最简洁的方式配置Redis Server, 以及如何使用C#和它交互编程 一. 背景介绍 Redis是最快的key-value分布式缓存之一 缺点: 没有本地数据缓冲, 目前还没 ...

  3. 本地计算机 上的 Redis Server 服务启动后停止

    服务器上Redis服务安装正常..却启动不了.. 报错  :   本地计算机 上的 Redis Server 服务启动后停止.某些服务在未由其他服务或程序使用时将自动停止. 最后发现是Redis的配置 ...

  4. windows redis:Uncaught exception 'RedisException' with message 'Redis server went away'

    window-exe-redis-2.8.12服务,当你复制好php_igbinary.dll,php_redis.dll时候,你运行redis报错:Fatal error: Uncaught exc ...

  5. redis客户端连接服务端the version of redis server is too low to support this function错误

    redis作为一个内存数据库,使用得当可以大大的提升系统运行的效率,据说能读的速度是110000次/s,写的速度是81000次/s,我们的其中一个系统就用到了这个. 由于之前负责这个的同事离职,只好临 ...

  6. mac上配置mysql与redis server,并结合Pydev准备某爬虫环境

    mysql下安装mysql server mysql下安装redis server:https://www.jianshu.com/p/3bdfda703552 mac下安装配置redis:https ...

  7. Redis server went away的解决方案

    Redis server went away出现的问题如下: 1.看redis服务是否启动,包括端口 2.看是否是服务器端的防火墙引起的,iptables和selinux 3.看是否是redis.co ...

  8. redis error It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketFailure on PING

    应用redis出现如下错误 It was not possible to connect to the redis server(s); to create a disconnected multip ...

  9. Linux 下安装 Redis server

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/defonds/article/details/30047611         本文简介了 Linu ...

  10. C# Redis Server分布式缓存编程(一)(转)

    出处:http://www.cnblogs.com/davidgu/p/3262571.html 这篇文章我将介绍如果用最简洁的方式配置Redis Server, 以及如何使用C#和它交互编程 一. ...

随机推荐

  1. Python 入门之格式化输出

    Python 入门之格式化输出 1.格式化 (1)%为占位 (2)%s --- 站字符串的位置(数字.字符串都能够进行填充) name = input('请输入姓名:') age = input('请 ...

  2. React全家桶入门

    http://blog.csdn.net/column/details/14545.html

  3. Python 循环异或对文件进行加解密

    # -* -coding: UTF-8 -* - # 功能:异或方式对文件进行加密和解密 import os import datetime # 主函数 def main(): getInput() ...

  4. MySQL索引优化(索引三表优化案例)

    建表SQL phone.book表建立索引 [关联优化查询建议] 1.保证被驱动表的join字段已经被索引 被驱动表  join 后的表为被驱动表  (需要被查询) 2.left join 时,选择小 ...

  5. 对于springmvc 很奇妙的报404错误的记录

    @RequestMapping("/editItems") public ModelAndView editItems(Integer id) throws Exception { ...

  6. deletefile 与KILL

    1.Kill 语句 从磁盘中删除文件.语法Kill pathname必要的 pathname 参数是用来指定一个文件名的字符串表达式.pathname 可以包含目录或文件夹.以及驱动器.说明在 Mic ...

  7. Codeforces 962 /2错误 相间位置排列 堆模拟 X轴距离最小值 前向星点双连通分量求只存在在一个简单环中的边

    A #include <bits/stdc++.h> #define PI acos(-1.0) #define mem(a,b) memset((a),b,sizeof(a)) #def ...

  8. os模块 sys模块 json/pickle 模块 logging模块

    目录 模块 1. os模块 2. sys模块 3. json和pickle模块 4. logging模块 (1)日志配置 (2)实际开发中日志的使用 模块 1. os模块 os模块有什么用 与操作系统 ...

  9. java:类集框架conllection接口list,set

    类集中提供了以下几种接口: 1.单值操作接口:conllection,List,Set list和set是conllection接口的子接口 2.一对值的操作接口:Map 3.排序的操作接口:Sort ...

  10. display:line-block

    1.那是因为第二个标签是inline-block,它的对齐方式是基线对齐,对齐的是第一个元素里面字的下划线,所以第二个元素的下边缘对齐的是1的下划线,只要在第二个元素里面加内容或者加个空格( )就可以 ...