summaryrefslogtreecommitdiff
path: root/libexecs
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-04-23 16:40:44 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-04-23 16:40:44 +0000
commiteafba37e2bfc3897e3e7f65f2ce087fbee358f43 (patch)
tree7acd5c8fea2ad7a00ba393799f0a155417edf07d /libexecs
parent56b4fc537662d8d42f366b5cb5be0eada79d8d56 (diff)
parent88051a6ab096b20ab098434fd4d4c127efca910f (diff)
downloadtrove-setup-eafba37e2bfc3897e3e7f65f2ce087fbee358f43.tar.gz
Merge branch 'baserock/liw/new-lc-2'
Reviewed by Daniel and Richard on the mailing list, and further changes based on review feedback by Richard on IRC. Reviewed-by: Richard Maw Reviewed-by: Daniel Silverstone
Diffstat (limited to 'libexecs')
-rwxr-xr-xlibexecs/remove-lorry-controller-from-lorry-crontab22
1 files changed, 22 insertions, 0 deletions
diff --git a/libexecs/remove-lorry-controller-from-lorry-crontab b/libexecs/remove-lorry-controller-from-lorry-crontab
new file mode 100755
index 0000000..8fc6cf3
--- /dev/null
+++ b/libexecs/remove-lorry-controller-from-lorry-crontab
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Trove used to run a version of Lorry Controller that wasn't a
+# daemon, but instead was invoked once a minute from a crontab owned
+# by the lorry user. When we upgrade to a version of Lorry Controller
+# that does run as a daemon, we need to disable the cronjob. This
+# script does that.
+#
+# The lorry user crontab may contain other jobs, so we can't just
+# willy-nilly delete the whole crontab. Instead, we remove the
+# specific line. The line looks like this:
+#
+# */1 * * * * flock -x -n /home/lorry/lorry-controller-area/lockfile
+# -c lorry-controller --work-area=/home/lorry/lorry-controller-area
+# --log=syslog --log-level=info --html-file=/home/lorry/lc-status.html
+#
+# Except, of course, all on one line.
+
+
+crontab -l |
+grep -v -e '-c lorry-controller' |
+crontab -