Rei*_*Rei 8 startup centos services
当我启动 CentOS 机器时,该httpd
服务会自动启动。我如何制作做同样事情的定制服务?我有一个用于挖矿的程序,我不想./miner
每次启动机器时都需要运行。
小智 13
由于您使用的是 CentOS 7.x,因此请创建一个单元。vim /usr/lib/systemd/system/miner.service
如root
,把下列内容:
[Unit]
Description=miner
[Service]
ExecStart=/path/to/miner
[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)
如果有用于关闭或重新加载服务的特定参数,您可以添加ExecStop=
和ExecReload=
选项。
之后,您只需要systemctl enable miner.service
让它在每次启动时启动。
相关资料:
归档时间: |
|
查看次数: |
47880 次 |
最近记录: |