From 5deb1d066dc116a1f6c2a29b60aab93e9cdb0960 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 1 May 2007 23:10:42 +0200 Subject: [PATCH] collectd.postinst: Pass hostname to migrate-3-4.px and fix new DataDir. * hostname should only default to "localhost" if hostname(1) returned the empty string * move new DataDir to /var/lib/collectd/rrd instead of /var/lib/collectd/ --- debian/collectd.postinst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/collectd.postinst b/debian/collectd.postinst index 82cfa51..b9b5b14 100755 --- a/debian/collectd.postinst +++ b/debian/collectd.postinst @@ -24,12 +24,17 @@ case "$1" in db_get collectd/auto-migrate-3-4 if [ "$RET" = "true" ]; then tmpdir=`mktemp -dt collectd.XXXXXXXXXX` + hostname=`hostname` + + if [ -z "$hostname" ]; then hostname="localhost"; fi cp -a /var/lib/collectd/ /var/backups/collectd-"$2" - /usr/lib/collectd/utils/migrate-3-4.px -o $tmpdir | bash + /usr/lib/collectd/utils/migrate-3-4.px \ + --hostname="$hostname" --outdir="$tmpdir" | bash rm -rf /var/lib/collectd/ - mv $tmpdir /var/lib/collectd/ + mkdir /var/lib/collectd/ + mv $tmpdir /var/lib/collectd/rrd fi ;; -- 2.30.2