我有两个upstart脚本,一个用于启动teamspeak服务器,另一个用于启动teamspeak bot,如下所示.
teamspeak.service:
[Unit]
Description=Teamspeak Server
After=network.target
[Service]
WorkingDirectory=/home/teamspeak/
User=teamspeak
Group=teamspeak
Type=forking
ExecStart=/home/teamspeak/ts3server_startscript.sh start
ExecStop=/home/teamspeak/ts3server_startscript.sh stop
ExecReload=/home/teamspeak/ts3server_startscript.sh restart
PIDFile=/home/teamspeak/ts3server.pid
RestartSec=15
Restart=always
[Install]
WantedBy=multi-user.target
tsbot.service
[Unit]
Description=Teamspeak Bot
After=network.target
[Service]
WorkingDirectory=/home/tsbot/
User=tsbot
Group=tsbot
Type=forking
ExecStart=/home/tsbot/jts3servermod_startscript.sh start
ExecStop=//home/tsbot/jts3servermod_startscript.sh stop
ExecReload=/home/tsbot/jts3servermod_startscript.sh restart
PIDFile=/home/tsbot/jts3servermod.pid
RestartSec=15
Restart=always
[Install]
WantedBy=multi-user.target
我想知道只有在teamspeak.service成功启动之后才能执行tsbot.service脚本,我尝试将After = network.target teamspeak.service添加到脚本但是没有用.