Linux源码安装的Redis如何配置systemd管理并设置开机启动

文章目录

实验前提

  • 已完成源码安装并能正常启动redis
bash 复制代码
/usr/local/bin/redis-server

能正常启动redis

实验

bash 复制代码
vim /etc/systemd/system/redis.service

内容如下:

bash 复制代码
[unit]
Description=redis-server
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/bin/redis-server
PrivateTmp=true

[Install]
WantedBy=multi-user.target

尝试启动服务

bash 复制代码
systemctl start redis

设置开机启动

bash 复制代码
systemctl enable redis
相关推荐
weixin_5160230721 小时前
linux下fcitx5拼音的安装
linux·运维·服务器
難釋懷1 天前
Redis命令-Set命令
数据库·redis·缓存
编程小风筝1 天前
Spring 框架如何整合Redis缓存中间件?
redis·spring·缓存
hunter14501 天前
Linux 进程与计划任务
linux·运维·服务器
楼田莉子1 天前
Linux学习之磁盘与Ext系列文件
linux·运维·服务器·c语言·学习
陌上花开缓缓归以1 天前
linux 怎么模拟系统panic重启
linux·运维·服务器
KL's pig/猪头/爱心/猪头1 天前
写一个rv1106的led驱动3-功能函数编写
linux·驱动开发·rv1106
月白风清江有声1 天前
vscode使用git
linux·运维·服务器
zl_dfq1 天前
Linux 之 【文件】(ext2文件系统、目录、软硬链接)
linux
物理与数学1 天前
Linux 内核 LRU 页面置换算法
linux·linux内核