1 Star 0 Fork 0

cym504875043/文档手册

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
systemctl.md 1.55 KB
一键复制 编辑 原始数据 按行查看 历史
cym504875043 提交于 3年前 . systemctl.md修改
centos7脚本存放地址

开机不登陆帐号就要运行的建议放在系统 =>system

#存放地址,系统=>(system) | 用户=>(user)
/usr/lib/systemd/[system|user]
服务说明

第一:每个服务文件以(.service)结尾 第二:文件内容分为三部分:

  • [Unit]
  • [Service]
  • [Install]
#[Unit]部分主要是对这个服务的说明,内容包括Description、After
#Description =>描述信息
#After       =>用于描述服务类别
[Unit]
Description = test
After = this is test
#[Service]
#Type = forking #后台运行的形式
#PIDFile=/tmp/pid #存放PID的文件路径
#ExecStart #服务的具体运行命令
#ExecReload #重启命令
#execStop #停止命令
#PrivateTep=ture #给服务器分配独立的临时空间
#Restart=always #程序异常终止的时候,都会自动重启这个进程
#RestartSec=1 #重启的间隔是1秒
[Service]
Type=forking
PIDFile=/node.js/pid
ExecStart=/usr/local/bin/test start
ExecReload=/usr/local/bin/test restart
ExecStop=/usr/local/bin/test stop
PrivateTmp=true
#[Install]部分服务安装的相关设置,可设置为多用户
[Install]
WantedBy=multi-user.target
服务说明
/usr/lib/systemd/system/test.service
chomd 754 /usr/lib/systemd/system/test.service
systemctl [start|restart|reload|enable|disable|statue] test.service
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/jike/doc-man.git
git@gitee.com:jike/doc-man.git
jike
doc-man
文档手册
master

搜索帮助