linux service
service与chkconfig的替代者systemctl
https://blog.csdn.net/itcomputer12/article/details/41799139
systemctl创建 service
https://blog.csdn.net/gbenson/article/details/51083817
https://blog.csdn.net/qq_14852397/article/details/71794574?locationNum=11&fps=1
https://blog.csdn.net/chwshuang/article/details/68489968
创建Redis服务过程
sudo vi /lib/systemd/system/redis.service
[Unit]
Description=Redis
After=network.target
[Service]
ExecStart=/opt/redis-4.0.9/src/redis-server /opt/redis-4.0.9/redis.conf --daemonize no
ExecStop=/opt/redis-4.0.9/src/redis-cli -h 127.0.0.1 -p 6379 -a ${password} shutdown
[Install]
WantedBy=multi-user.target
运行shell
systemctl daemon-reload
systemctl enable redis
systemctl start redis
注:
systemctl enable redis 相当于执行了: ln -s /lib/systemd/system/redis.service /etc/systemd/system/multi-user.target.wants/redis.service
查看开机启动项
http://www.cnblogs.com/end/archive/2012/10/12/2721059.html
sudo apt-get install sysv-rc-conf
sysv-rc-conf
systemctl list-unit-files
列出所有状态 : service --status-all
启动sshd服务
service sshd start
设置sshd服务开机启动
chkconfig sshd start
![]() |
作者:NewSea 出处:http://newsea.cnblogs.com/
QQ,MSN:iamnewsea@hotmail.com 如无特别标记说明,均为NewSea原创,版权私有,翻载必纠。欢迎交流,转载,但要在页面明显位置给出原文连接。谢谢。 |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 周边上新:园子的第一款马克杯温暖上架
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
· 使用C#创建一个MCP客户端
2012-04-17 Js 定义对象的方法
2012-04-17 试用 CouchBase。