|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 |
| -echo [Unit] | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
4 |
| -echo Description=DCM REST Client | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 3 | +# TODO we should change this so it reflects latest changes |
| 4 | + |
| 5 | +echo "[Unit]" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 6 | +echo "Description=DCM REST Client" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 7 | +echo "Requires=kafka-mirror-french-site.service kafka-mirror-greek-site.service kafka-mirror-italian-site.service kafka-mirror-spanish-site.service" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 8 | +echo "After=kafka-mirror-french-site.service kafka-mirror-greek-site.service kafka-mirror-italian-site.service kafka-mirror-spanish-site.service" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
5 | 9 | echo | sudo tee -a /etc/systemd/system/dcm.service > /dev/null
|
6 |
| -echo [Service] | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
7 |
| -echo User=$1 | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
8 |
| -echo ExecStart=/usr/bin/sudo /usr/bin/python3 /usr/bin/dcm/dcm-python/dcm_rest_client.py --dcm_ip_address $2 --spanish_site_plugin_ip_port $3 --italian_site_plugin_ip_port $4 --french_site_plugin_ip_port $5 --greek_site_plugin_ip_port $6 --port 8090 --log info | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 10 | +echo "[Service]" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 11 | +echo "User=$1" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 12 | +echo "ExecStart=/usr/bin/sudo /usr/bin/python3 /usr/bin/dcm/dcm-python/dcm_rest_client.py --dcm_ip_address $2 --spanish_site_plugin_ip_port $3 --italian_site_plugin_ip_port $4 --french_site_plugin_ip_port $5 --greek_site_plugin_ip_port $6 --port 8090 --log info" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 13 | +echo "TimeoutSec=10" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 14 | +echo "Restart=on-failure" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 15 | +echo "RestartSec=1" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
9 | 16 | echo | sudo tee -a /etc/systemd/system/dcm.service > /dev/null
|
10 |
| -echo [Install] | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
11 |
| -echo WantedBy=default.target | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 17 | +echo "[Install]" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
| 18 | +echo "WantedBy=default.target" | sudo tee -a /etc/systemd/system/dcm.service > /dev/null |
12 | 19 |
|
13 | 20 | sudo chmod 664 /etc/systemd/system/dcm.service
|
14 | 21 | sudo systemctl daemon-reload
|
|
0 commit comments