From c060ac43ba9e2caa07094c422ff5bb74f1fca3cf Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 12 Mar 2014 14:12:23 +0000 Subject: Remove now-useless crontab for lorry user --- bins/trove-early-setup | 1 - 1 file changed, 1 deletion(-) diff --git a/bins/trove-early-setup b/bins/trove-early-setup index 308a3e7..49675e8 100755 --- a/bins/trove-early-setup +++ b/bins/trove-early-setup @@ -80,7 +80,6 @@ gitano-configured: /home/git/.gitano-setup su -c "cd /tmp/lorries; git add README lorry-controller.conf open-source-lorries/README closed-source-lorries/README; git commit -m 'Initial configuration'; git push origin master" - git su -c "rm -rf /tmp/lorries" - git su -c "cd /home/lorry/lorry-controller-area/git; git remote update; git checkout master" - lorry - su -c "echo '*/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' | crontab -" - lorry touch $@ .PHONY: lorry-configured -- cgit v1.2.1 From b51e297ef3c4b8dfaf99acb4bfbd4d4eaa2146c2 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 14 Mar 2014 13:57:17 +0000 Subject: Make lorry run verbosely This works better with the output logging in the new Lorry Controller. --- etc/lorry.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/lorry.conf b/etc/lorry.conf index 65eaac8..4cfb01a 100644 --- a/etc/lorry.conf +++ b/etc/lorry.conf @@ -6,3 +6,4 @@ bundle-dest = /home/lorry/bundles tarball = always tarball-dest = /home/lorry/tarballs working-area = /home/lorry/working-area +verbose = yes -- cgit v1.2.1 From a26d9ade4a6fe9d66103cbe47de792a0f804747a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 20 Mar 2014 15:41:23 +0000 Subject: Remove creation of /home/lorry/lorry-controller-area The new Lorry Controller does that itself. --- bins/trove-early-setup | 3 --- 1 file changed, 3 deletions(-) diff --git a/bins/trove-early-setup b/bins/trove-early-setup index 49675e8..5ce2d7a 100755 --- a/bins/trove-early-setup +++ b/bins/trove-early-setup @@ -69,8 +69,6 @@ gitano-configured: /home/git/.gitano-setup PREFIX=$$(echo "##PREFIX##" | sed -f /etc/trove-setup.sed); \ su -c "ssh localhost create $${PREFIX}/local-config/lorries" - git; \ su -c "git clone ssh://localhost/$${PREFIX}/local-config/lorries.git /tmp/lorries" - git; \ - su -c "mkdir /home/lorry/lorry-controller-area" - lorry; \ - su -c "git clone ssh://git@localhost/$${PREFIX}/local-config/lorries.git /home/lorry/lorry-controller-area/git" - lorry su -c "sed -f /etc/trove-setup.sed < /usr/share/trove-setup/lorry-controller.conf > /tmp/lorries/lorry-controller.conf" - git su -c "sed -f /etc/trove-setup.sed < /usr/share/trove-setup/README.lorry-controller > /tmp/lorries/README" - git su -c "mkdir /tmp/lorries/open-source-lorries" - git @@ -79,7 +77,6 @@ gitano-configured: /home/git/.gitano-setup su -c "cp /usr/share/trove-setup/closed-source-lorries/README /tmp/lorries/closed-source-lorries/README" - git su -c "cd /tmp/lorries; git add README lorry-controller.conf open-source-lorries/README closed-source-lorries/README; git commit -m 'Initial configuration'; git push origin master" - git su -c "rm -rf /tmp/lorries" - git - su -c "cd /home/lorry/lorry-controller-area/git; git remote update; git checkout master" - lorry touch $@ .PHONY: lorry-configured -- cgit v1.2.1 From b3b942117cad7d70b1428e23bfef43909a5da432 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 20 Mar 2014 15:44:25 +0000 Subject: Set trovehost in lorry-controller.conf to $UPSTREAM_TROVE --- share/lorry-controller.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/lorry-controller.conf b/share/lorry-controller.conf index 6004171..b8066c3 100644 --- a/share/lorry-controller.conf +++ b/share/lorry-controller.conf @@ -3,8 +3,8 @@ "type": "trove", "uuid": "##PREFIX##/initial", "serial": 1, - "trovehost": "git.baserock.org", - "protocol": "ssh", + "trovehost": "##UPSTREAM_TROVE##", + "protocol": "ssh", "ls-interval": "4H", "interval": "2H", "create": "always", -- cgit v1.2.1 From e21824a611c021ef17e201038c4751a5a523b193 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 20 Mar 2014 16:39:36 +0000 Subject: Add a symlink to the LC static files into htdocs --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 453c01e..98fc86b 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ install: ln -s /home/lorry/bundles "${DESTDIR}/var/www/htdocs/bundles" ln -s /home/lorry/tarballs "${DESTDIR}/var/www/htdocs/tarballs" ln -s /home/lorry/lc-status.html "${DESTDIR}/var/www/htdocs/lc-status.html" + ln -s /usr/share/lorry-controller/static/ "${DESTDIR}/var/www/htdocs/lc-static" mkdir -p "${DESTDIR}/usr/bin" cp bins/* "${DESTDIR}/usr/bin/" mkdir -p "${DESTDIR}/usr/share/trove-setup" -- cgit v1.2.1 From 810fb85f4bbe4c848a2c83bcf3b4be05625ecdbb Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 10 Apr 2014 12:44:24 +0000 Subject: Expands TABs in share/lorry-controller.conf --- share/lorry-controller.conf | 84 ++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/share/lorry-controller.conf b/share/lorry-controller.conf index b8066c3..bdbbbd5 100644 --- a/share/lorry-controller.conf +++ b/share/lorry-controller.conf @@ -1,50 +1,50 @@ [ { - "type": "trove", - "uuid": "##PREFIX##/initial", - "serial": 1, - "trovehost": "##UPSTREAM_TROVE##", - "protocol": "ssh", - "ls-interval": "4H", - "interval": "2H", - "create": "always", - "destroy": "never", - "stagger": true, - "prefixmap": { - "baserock": "baserock", - "delta": "delta" - }, - "ignore": [ - "baserock/lorries" - ], - "tarball": "always" + "type": "trove", + "uuid": "##PREFIX##/initial", + "serial": 1, + "trovehost": "##UPSTREAM_TROVE##", + "protocol": "ssh", + "ls-interval": "4H", + "interval": "2H", + "create": "always", + "destroy": "never", + "stagger": true, + "prefixmap": { + "baserock": "baserock", + "delta": "delta" + }, + "ignore": [ + "baserock/lorries" + ], + "tarball": "always" }, { - "type": "lorries", - "uuid": "##PREFIX##/open-source-lorries", - "serial": 1, - "interval": "6H", - "create": "always", - "destroy": "never", - "stagger": true, - "prefix": "delta", - "tarball": "always", - "globs": [ - "open-source-lorries/*.lorry" - ] + "type": "lorries", + "uuid": "##PREFIX##/open-source-lorries", + "serial": 1, + "interval": "6H", + "create": "always", + "destroy": "never", + "stagger": true, + "prefix": "delta", + "tarball": "always", + "globs": [ + "open-source-lorries/*.lorry" + ] }, { - "type": "lorries", - "uuid": "##PREFIX##/closed-source-lorries", - "serial": 1, - "interval": "6H", - "create": "always", - "destroy": "never", - "stagger": true, - "prefix": "delta", - "tarball": "always", - "globs": [ - "closed-source-lorries/*.lorry" - ] + "type": "lorries", + "uuid": "##PREFIX##/closed-source-lorries", + "serial": 1, + "interval": "6H", + "create": "always", + "destroy": "never", + "stagger": true, + "prefix": "delta", + "tarball": "always", + "globs": [ + "closed-source-lorries/*.lorry" + ] } ] -- cgit v1.2.1 From 2831109ad7398fd5d7a86559b4ba3eb3a85ebb8e Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 22 Apr 2014 13:50:50 +0000 Subject: Add script to remove lorry-controller from lorry's crontab --- Makefile | 2 ++ .../remove-lorry-controller-from-lorry-crontab | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 libexecs/remove-lorry-controller-from-lorry-crontab diff --git a/Makefile b/Makefile index 98fc86b..3a64344 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,8 @@ install: ln -s /usr/share/lorry-controller/static/ "${DESTDIR}/var/www/htdocs/lc-static" mkdir -p "${DESTDIR}/usr/bin" cp bins/* "${DESTDIR}/usr/bin/" + mkdir -p "${DESTDIR}/usr/libexec" + cp libexecs/* "${DESTDIR}/usr/libexec/" mkdir -p "${DESTDIR}/usr/share/trove-setup" cp -r share/* "${DESTDIR}/usr/share/trove-setup/" 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 - -- cgit v1.2.1 From 5b475b38ddc3bb1e373110e81cd1d00d9dcfd246 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 22 Apr 2014 13:56:14 +0000 Subject: Add unit for modifying lorry crontab --- units/drop-lorry-controller-cronjob.service | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 units/drop-lorry-controller-cronjob.service diff --git a/units/drop-lorry-controller-cronjob.service b/units/drop-lorry-controller-cronjob.service new file mode 100644 index 0000000..8cad21f --- /dev/null +++ b/units/drop-lorry-controller-cronjob.service @@ -0,0 +1,13 @@ +[Unit] +Description=Drop lorry-controller from lorry's crontab +After=basic.target +ConditionPathExists=!/etc/lorry-controller/lorry-controller-removed-from-crontab + +[Service] +Type=oneshot +Restart=no +ExecStart=/usr/libexec/remove-lorry-controller-from-lorry-crontab +ExecStartPost=/bin/touch /etc/lorry-controller/lorry-controller-removed-from-crontab +User=lorry +Group=lorry +PermissionsStartOnly=true -- cgit v1.2.1 From 88051a6ab096b20ab098434fd4d4c127efca910f Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 22 Apr 2014 16:41:34 +0000 Subject: Make lorry log to stdout This will make the output be even more verbose for Trove's Lorry Controller. --- etc/lorry.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/lorry.conf b/etc/lorry.conf index 4cfb01a..16552cb 100644 --- a/etc/lorry.conf +++ b/etc/lorry.conf @@ -7,3 +7,5 @@ tarball = always tarball-dest = /home/lorry/tarballs working-area = /home/lorry/working-area verbose = yes +log = /dev/stdout +log-level = debug -- cgit v1.2.1