0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

jenkins swarm clientの自動起動・停止

Posted at

1.起動用シェルファイルを作成

/home/ec2-user/swarmd.sh

#!/bin/bash
cd /home/ec2-user
java -jar /home/ec2-user/swarm-client-3.29.jar -executors 2 -disableSslVerification  -master http://172.31.34.77:8080 -name swarm-node -username admin -password xxxxxx -mode exclusive &

2.unitファイルを作成

/etc/systemd/system/swarmd.service

[Unit]
Description=swarm connection daemon
After=network.target

[Service]
SuccessExitStatus=143
Type=forking
User=ec2-user
Group=ec2-user
ExecStart=/home/ec2-user/swarmd.sh
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

3.サービスをenable・start

sudo systemctl daemon-reload
sudo systemctl enable swarmd
sudo systemctl start swarmd
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?