# HG changeset patch # User Hans-G?nter Theisgen # Date 1644941626 -3600 # Node ID 92d14c9730a8b3b474cdf3cb0128b09ecfec5d49 # Parent e8070450126d433911a77e922416050f1a006c23 cyrus-imapd: configured libexecdir diff -r e8070450126d -r 92d14c9730a8 cyrus-imapd/receipt --- a/cyrus-imapd/receipt Tue Feb 15 14:10:08 2022 +0100 +++ b/cyrus-imapd/receipt Tue Feb 15 17:13:46 2022 +0100 @@ -39,6 +39,7 @@ CXX=g++-83 \ --prefix=/usr \ --infodir=/usr/share/info \ + --libexecdir=/usr/libexec/cyrus \ --with-com_err=yes \ --enable-murder \ --enable-replication \ @@ -52,6 +53,7 @@ genpkg_rules() { mkdir -p $fs/usr/lib/cyrus + mkdir -p $fs/usr/libexec mkdir -p $fs/var/imap mkdir -p $fs/var/spool/imap/stage. @@ -59,6 +61,9 @@ cp -a $install/usr/lib/libcyrus*.so* $fs/usr/lib cp -a $install/usr/lib/perl5 $fs/usr/lib strip -s $fs/usr/lib/lib* + cp -a $install/usr/libexec/cyrus $fs/usr/libexec + cp -a $install/usr/sbin $fs/usr + cp $src/tools/mkimap $fs/usr/lib/cyrus cp -a $stuff/etc $fs cp $src/doc/examples/cyrus_conf/small.conf \ @@ -140,7 +145,7 @@ do echo "createmailbox user.$i" done | chroot "$1/" cyradm -u cyrus -w cyrus 127.0.0.1 >/dev/null 2>&1 - chroot "$1/" su -c "/usr/lib/cyrus/bin/reconstruct" cyrus >/dev/null 2>&1 + chroot "$1/" su -c "/usr/sbin/reconstruct" cyrus >/dev/null 2>&1 cat </dev/null; then - /etc/init.d/cyrus-sasl start - fi - action 'Starting %s: %s...' "$DESC" $NAME - $DAEMON $OPTIONS - status - sleep 2 - ;; - stop) - if ! active_pidfile $PIDFILE master ; then - _ '%s is not running.' $NAME - exit 1 - fi - action 'Stopping %s: %s...' "$DESC" $NAME - kill $(cat $PIDFILE) - ps x | grep -q $(cat $PIDFILE) || rm -f $PIDFILE - status - ;; - restart) - if ! active_pidfile $PIDFILE master ; then - _ '%s is not running.' $NAME - exit 1 - fi - action 'Restarting %s: %s...' "$DESC" $NAME - kill $(cat $PIDFILE) - if ps x | grep -q $(cat $PIDFILE); then - false - else - rm -f $PIDFILE - sleep 2 - $DAEMON $OPTIONS - fi - status - ;; - *) - emsg "$(_ 'Usage:') $0 [start|stop|restart]" - newline - exit 1 - ;; + (start) + if active_pidfile $PIDFILE master + then + _ '%s is already running.' $NAME + exit 1 + fi + dir=$(grep ^configdirectory /etc/imapd.conf | awk '{print $2}') + if [ ! -f $dir/mailboxes.db ] + then + action 'Initialize %s...' "$DESC" + #/usr/cyrus/bin/mkimap + for i in db proc socket log msg user quota + do + [ -d $dir/$i ] || mkdir -p -m 700 $dir/$i + done + for i in user quota + do + for j in a b c d e f g h i j k l m n o p q r s t u v w x y z + do + [ -d $dir/$i/$j ] || mkdir -p $dir/$i/$j + done + done + chown -R cyrus:mail $dir + chmod 750 $dir $dir/socket + for i in $(grep ^partition /etc/imapd.conf | awk '{ print $2 }') + do + [ -d $i ] || mkdir -p -m 750 $i + case "$(grep ^hashimapspool /etc/imapd.conf | awk '{ print $2 }')" in + (y*|t*|1|on) + for j in a b c d e f g h i j k l m n o p q r s t u v w x y z + do + [ -d $i/$j ] || mkdir -p $i/$j + done + ;; + esac + [ -d $i/stage. ] || mkdir $i/stage. + chown -R cyrus:mail $i + done + case "$(grep ^sieveusehomedir /etc/imapd.conf | awk '{ print $2 }')" in + (y*|t*|1|on) + sieve=$(grep ^sievedir /etc/sieve | awk '{ print $2 }') + [ -d $sieve ] || mkdir $sieve + chmod 755 $sieve + for j in a b c d e f g h i j k l m n o p q r s t u v w x y z + do + [ -d $sieve/$j ] || mkdir -p -m 755 $sieve/$j + done + chown -R cyrus:mail $sieve + ;; + esac + su cyrus -c "/usr/sbin/ctl_cyrusdb -r" + su cyrus -c "/usr/sbin/reconstruct" + status + fi + if ! pidof saslauthd >/dev/null + then + /etc/init.d/cyrus-sasl start + fi + action 'Starting %s: %s...' "$DESC" $NAME + $DAEMON $OPTIONS + status + sleep 2 + ;; + (stop) + if ! active_pidfile $PIDFILE master + then + _ '%s is not running.' $NAME + exit 1 + fi + action 'Stopping %s: %s...' "$DESC" $NAME + kill $(cat $PIDFILE) + ps x | grep -q $(cat $PIDFILE) || rm -f $PIDFILE + status + ;; + (restart) + if ! active_pidfile $PIDFILE master + then + _ '%s is not running.' $NAME + exit 1 + fi + action 'Restarting %s: %s...' "$DESC" $NAME + kill $(cat $PIDFILE) + if ps x | grep -q $(cat $PIDFILE) + then + false + else + rm -f $PIDFILE + sleep 2 + $DAEMON $OPTIONS + fi + status + ;; + (*) + emsg "$(_ 'Usage:') $0 [start|stop|restart]" + newline + exit 1 + ;; esac exit 0