[Unit] Description=TeamCity Build Agent After=network.target [Service] Type=oneshot User=root Group=root ExecStart=/root/agent/bin/agent.sh start ExecStop=-/root/agent/bin/agent.sh stop RemainAfterExit=yes SuccessExitStatus=0 143 [Install] WantedBy=default.target