bash - 成功启动systemd后执行bash脚本?

标签 bash daemon systemd

我有以下内容的 /etc/systemd/system/tivalue.service:

[Unit]
Description=Ti-Value Node
After=network.target

[Service]
Type=simple
PIDFile=/var/run/tivalue.pid

User=root
Group=root

ExecStart=/root/TiValue/tiValue --rpcuser=admin --rpcpassword=123456 --httpdendpoint=127.0.0.1:8080 --daemon
KillSignal=15
Restart=always

[Install]
WantedBy=multi-user.target

还有 /etc/systemd/system/tivalue.curl.sh
那么,如何在成功启动 /etc/systemd/system/tivalue.curl.sh 后执行 tivalue.service 呢?

最佳答案

使用指向脚本的 ExecStartPost= 条目。见 ExecStartPre/ExecStartPost documentation .

关于bash - 成功启动systemd后执行bash脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47980146/

相关文章:

linux - bash shell : Cannot use variable $ as a path to run tar

docker - 是否建议在 docker 容器内运行 systemd?

docker - 在centos 7 docker上的cron(和systemd)

c++ - init.d 守护程序脚本 (linux) 中的 lockfile 用途

php - php写linux守护进程用hiphop编译混淆需要考虑什么

c - systemd 如何向服务发送消息以引发 sd_notify(3) 响应?

linux - 什么是插入文件?什么是插入式目录?如何编辑systemd服务

python - 从父 bash 脚本中不可用的 Python 创建环境变量

mysql - 编辑 Bash 脚本以显示输出

linux - 如何在linux中模拟挂起的任务?