← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/turnip:charm-restart-services into turnip:master

 

Colin Watson has proposed merging ~cjwatson/turnip:charm-restart-services into turnip:master.

Commit message:
Restart services on failure

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1982814 in turnip: "Improve turnip-api service resiliency"
  https://bugs.launchpad.net/turnip/+bug/1982814

For more details, see:
https://code.launchpad.net/~cjwatson/turnip/+git/turnip/+merge/427417

systemd.service(5) recommends this for long-running services.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/turnip:charm-restart-services into turnip:master.
diff --git a/charm/turnip-api/templates/turnip-api.service.j2 b/charm/turnip-api/templates/turnip-api.service.j2
index 2cecf01..1c0bfa1 100644
--- a/charm/turnip-api/templates/turnip-api.service.j2
+++ b/charm/turnip-api/templates/turnip-api.service.j2
@@ -19,6 +19,7 @@ ExecReload=/bin/kill -s HUP $MAINPID
 ExecStop=/bin/kill -s TERM $MAINPID
 LimitNOFILE=1048576
 PrivateTmp=true
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target
diff --git a/charm/turnip-celery/templates/turnip-celery-repack.service.j2 b/charm/turnip-celery/templates/turnip-celery-repack.service.j2
index 631fc3f..c463d1a 100644
--- a/charm/turnip-celery/templates/turnip-celery-repack.service.j2
+++ b/charm/turnip-celery/templates/turnip-celery-repack.service.j2
@@ -21,6 +21,7 @@ ExecReload=/bin/kill -s HUP $MAINPID
 ExecStop=/bin/kill -s TERM $MAINPID
 LimitNOFILE=1048576
 PrivateTmp=true
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target
diff --git a/charm/turnip-celery/templates/turnip-celery.service.j2 b/charm/turnip-celery/templates/turnip-celery.service.j2
index d53b367..fd42471 100644
--- a/charm/turnip-celery/templates/turnip-celery.service.j2
+++ b/charm/turnip-celery/templates/turnip-celery.service.j2
@@ -21,6 +21,7 @@ ExecReload=/bin/kill -s HUP $MAINPID
 ExecStop=/bin/kill -s TERM $MAINPID
 LimitNOFILE=1048576
 PrivateTmp=true
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target
diff --git a/charm/turnip-pack-backend/templates/turnip-pack-backend.service.j2 b/charm/turnip-pack-backend/templates/turnip-pack-backend.service.j2
index 29d4cc6..d6dda6d 100644
--- a/charm/turnip-pack-backend/templates/turnip-pack-backend.service.j2
+++ b/charm/turnip-pack-backend/templates/turnip-pack-backend.service.j2
@@ -23,6 +23,7 @@ Environment=STATSD_ENVIRONMENT={{ statsd_environment }}
 ExecStart={{ venv_dir }}/bin/twistd --nodaemon --pidfile= --logfile={{ base_dir }}/logs/turnip-pack-backend.log --python=packbackendserver.tac
 ExecReload=/bin/kill -s HUP $MAINPID
 LimitNOFILE=1048576
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target
diff --git a/charm/turnip-pack-frontend-git/templates/turnip-pack-frontend-git.service.j2 b/charm/turnip-pack-frontend-git/templates/turnip-pack-frontend-git.service.j2
index e4de556..dc26fa9 100644
--- a/charm/turnip-pack-frontend-git/templates/turnip-pack-frontend-git.service.j2
+++ b/charm/turnip-pack-frontend-git/templates/turnip-pack-frontend-git.service.j2
@@ -12,6 +12,7 @@ Environment=PACK_VIRT_HOST={{ pack_virt_host }}
 Environment=PACK_VIRT_PORT={{ pack_virt_port }}
 ExecStart={{ venv_dir }}/bin/twistd --nodaemon --pidfile= --logfile={{ base_dir }}/logs/turnip-pack-frontend-git.log --python=packfrontendserver.tac
 ExecReload=/bin/kill -s HUP $MAINPID
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target
diff --git a/charm/turnip-pack-frontend-http/templates/turnip-pack-frontend-http.service.j2 b/charm/turnip-pack-frontend-http/templates/turnip-pack-frontend-http.service.j2
index 95d3d04..f115908 100644
--- a/charm/turnip-pack-frontend-http/templates/turnip-pack-frontend-http.service.j2
+++ b/charm/turnip-pack-frontend-http/templates/turnip-pack-frontend-http.service.j2
@@ -25,6 +25,7 @@ Environment=VIRTINFO_TIMEOUT={{ virtinfo_timeout }}
 ExecStart={{ venv_dir }}/bin/twistd --nodaemon --pidfile= --logfile={{ base_dir }}/logs/turnip-pack-frontend-http.log --python=httpserver.tac
 ExecReload=/bin/kill -s HUP $MAINPID
 LimitNOFILE=1048576
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target
diff --git a/charm/turnip-pack-frontend-ssh/templates/turnip-pack-frontend-ssh.service.j2 b/charm/turnip-pack-frontend-ssh/templates/turnip-pack-frontend-ssh.service.j2
index ca8a227..d9d5a1e 100644
--- a/charm/turnip-pack-frontend-ssh/templates/turnip-pack-frontend-ssh.service.j2
+++ b/charm/turnip-pack-frontend-ssh/templates/turnip-pack-frontend-ssh.service.j2
@@ -16,6 +16,7 @@ Environment=SMART_SSH_PORT={{ port }}
 Environment=TURNIP_LOG_DIR={{ base_dir }}/logs
 ExecStart={{ venv_dir }}/bin/twistd --nodaemon --pidfile= --logfile={{ base_dir }}/logs/turnip-pack-frontend-ssh.log --python=sshserver.tac
 ExecReload=/bin/kill -s HUP $MAINPID
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target
diff --git a/charm/turnip-pack-virt/templates/turnip-pack-virt.service.j2 b/charm/turnip-pack-virt/templates/turnip-pack-virt.service.j2
index efb574b..062cb79 100644
--- a/charm/turnip-pack-virt/templates/turnip-pack-virt.service.j2
+++ b/charm/turnip-pack-virt/templates/turnip-pack-virt.service.j2
@@ -14,6 +14,7 @@ Environment=VIRTINFO_ENDPOINT={{ virtinfo_endpoint }}
 Environment=VIRTINFO_TIMEOUT={{ virtinfo_timeout }}
 ExecStart={{ venv_dir }}/bin/twistd --nodaemon --pidfile= --logfile={{ base_dir }}/logs/turnip-pack-virt.log --python=virtserver.tac
 ExecReload=/bin/kill -s HUP $MAINPID
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target