service、systemd、systemctl 笔记1

                     

贡献者: addis

  • 本文处于草稿阶段。

   You can start and stop it manually with systemctl start scanner.service and systemctl stop scanner.service and see its status with systemctl status scanner.service.

   See Arch Linux help about systemd

更多参数

代码 2:名字.service
[Unit]
Description=服务的描述
Documentation=文档的url
After=在哪些服务运行后运行(如果它们没运行也没关系)
Before=在哪些服务之前运行(如果它们没运行也没关系)
Wants=在运行之前试图运行的另一个服务(如果失败也没关系)
Requires=在运行之前试图运行的另一个服务(如果失败就不运行)

[Service]
ExecStart=/路径/命令 参数1 参数2
ExecStop=/路径/命令 参数1 参数2
ExecStartPre=/路径/命令 参数1 参数2
Restart=always, on-failure, on-abnormal, on-watchdog, on-abort, no.
Type=simple(默认)|forking|oneshot|dbus, notify and idle.
User=运行服务的用户
Group=运行服务的组
Environment=环境变量
EnvironmentFile=环境变量文件

[Install]
WantedBy=在这个 target 启动该 service,失败也没关系
RequiredBy=失败有关系

1. supervisor


致读者: 小时百科一直以来坚持所有内容免费,这导致我们处于严重的亏损状态。 长此以往很可能会最终导致我们不得不选择大量广告以及内容付费等。 因此,我们请求广大读者热心打赏 ,使网站得以健康发展。 如果看到这条信息的每位读者能慷慨打赏 10 元,我们一个星期内就能脱离亏损, 并保证在接下来的一整年里向所有读者继续免费提供优质内容。 但遗憾的是只有不到 1% 的读者愿意捐款, 他们的付出帮助了 99% 的读者免费获取知识, 我们在此表示感谢。

                     

友情链接: 超理论坛 | ©小时科技 保留一切权利