特定服务后启动systemd服务? [英] Start systemd service after specific service?
问题描述
我有一个一般性的问题.在特定的 *.service
成功启动后,如何启动 systemd 单元 *.service
?
更具体的问题是,如何在 mongodb.service
启动后才启动 website.service
?换句话说,website.service
应该依赖于 mongodb.service
.
在 .service 文件中的 [Unit] 部分:
[单位]说明=我的网站After=syslog.target network.target mongodb.service
重要的部分是mongodb.service
手册页对其进行了描述,但是由于格式的原因,乍一看并不那么清楚
I have a general question. How does one start a systemd unit *.service
after a particular *.service
has started successfully?
More specific question is, how do I start website.service
only after mongodb.service
has started? In other words website.service
should depend on mongodb.service
.
In the .service file under the [Unit] section:
[Unit]
Description=My Website
After=syslog.target network.target mongodb.service
The important part is the mongodb.service
The manpage describes it however due to formatting it's not as clear on first sight
systemd.unit - not so well formatted
这篇关于特定服务后启动systemd服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!