From f33aeb98442fd29afeb57575b702234dd65aab29 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Thu, 25 May 2017 11:01:50 -0500 Subject: [PATCH] Remove cyr_systemd_helper completely. It turns that, at least in cyrus 3, the cyr_systemd_helper script will end up wiping out your databases every time the daemon starts. It was something that was needed to handle the horror that was Berkeley DB/Sleepycat DB/whatever it's called today, but Cyrus no longer supports BDB and so there's no point. --- cyr_systemd_helper | 38 -------------------------------------- cyrus-imapd.service | 2 -- cyrus-imapd.spec | 2 -- 3 files changed, 42 deletions(-) delete mode 100755 cyr_systemd_helper diff --git a/cyr_systemd_helper b/cyr_systemd_helper deleted file mode 100755 index 2d9ad56..0000000 --- a/cyr_systemd_helper +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# get_config [config default] -# extracts config option from config file -get_config() { - if conf=$(grep "^$1" /etc/imapd.conf); then - echo $conf | cut -d: -f2 - else - echo $2 - fi -} - -CONFIGDIRECTORY=$(get_config configdirectory /var/lib/imap) -RETVAL=0 - -start() { - cd $CONFIGDIRECTORY - runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all > ${CONFIGDIRECTORY}/rpm/db_import.log 2>&1" < /dev/null - RETVAL=$? -} - -stop() { - cd $CONFIGDIRECTORY - runuser - cyrus -s /bin/sh -c "umask 166 ; /usr/lib/cyrus-imapd/cvt_cyrusdb_all export > ${CONFIGDIRECTORY}/rpm/db_export.log 2>&1" < /dev/null - RETVAL=$? -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - *) - ;; -esac - -exit $RETVAL diff --git a/cyrus-imapd.service b/cyrus-imapd.service index 9fe5df7..2d28731 100644 --- a/cyrus-imapd.service +++ b/cyrus-imapd.service @@ -8,9 +8,7 @@ After=cyrus-imapd-init.service [Service] Type=simple EnvironmentFile=/etc/sysconfig/cyrus-imapd -ExecStartPre=/usr/lib/cyrus-imapd/cyr_systemd_helper start ExecStart=/usr/lib/cyrus-imapd/cyrus-master $CYRUSOPTIONS -ExecStopPost=/usr/lib/cyrus-imapd/cyr_systemd_helper stop PrivateTmp=true # Cyrus may spawn many processes in normal operation. These figures are higher diff --git a/cyrus-imapd.spec b/cyrus-imapd.spec index 7f23673..c033fb9 100644 --- a/cyrus-imapd.spec +++ b/cyrus-imapd.spec @@ -34,7 +34,6 @@ Source15: cyrus-imapd.cron-daily Source16: README.rpm Source17: cyrus-imapd.service Source18: cyrus-imapd-init.service -Source19: cyr_systemd_helper # Source files for running the Cassandane test suite at build time. Source80: https://github.com/cyrusimap/cassandane/archive/%cmt1.tar.gz#/cassandane-%{scmt %cmt1}.tar.gz @@ -332,7 +331,6 @@ END install -p -D -m 644 %SOURCE17 %buildroot/%_unitdir/cyrus-imapd.service install -p -D -m 644 %SOURCE18 %buildroot/%_unitdir/cyrus-imapd-init.service -install -p -D -m 755 %SOURCE19 %buildroot/%cyrexecdir/cyr_systemd_helper # Cleanup of doc dir find doc perl -name CVS -type d -prune -exec rm -rf {} \;