作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个python应用程序,它作为centos 7上的一项服务。
我在/usr/lib/systemd/system中用我的项目名称创建了一个文件。并在上面写这些:
[Unit]
Description=My Script Service
After=multi-user.target
[Service]
Type=idle
ExecStart=/usr/bin/python3.6 /usr/src/python-project/sampleService-services/serverprotocol.py
[Install]
WantedBy=multi-user.target
$ sudo systemctl daemon-reload
$ sudo systemctl enable sampleService.service
$ sudo reboot
$ systemctl start sampleService.service
$ systemctl restart sampleService
$ systemctl stop sampleService
$ systemctl reload sampleService
$ service sampleService reload
Failed to reload sampleService.service: Job type reload is not applicable for unit basiscore.service. See system logs and 'systemctl status sampleService.service' for details.
最佳答案
在ExecStart=
行下,尝试添加
Restart=on-failure
RestartSec=10s
关于linux - 如何在centos 7上重新加载pythonic服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51330007/
我是一名优秀的程序员,十分优秀!