wok-current rev 24452

cyrus-imapd: configured libexecdir
author Hans-G?nter Theisgen
date Tue Feb 15 17:13:46 2022 +0100 (2022-02-15)
parents e8070450126d
children 241fb98cab1c
files cyrus-imapd/receipt cyrus-imapd/stuff/etc/init.d/cyrus-imapd
line diff
     1.1 --- a/cyrus-imapd/receipt	Tue Feb 15 14:10:08 2022 +0100
     1.2 +++ b/cyrus-imapd/receipt	Tue Feb 15 17:13:46 2022 +0100
     1.3 @@ -39,6 +39,7 @@
     1.4  		CXX=g++-83				\
     1.5  		--prefix=/usr				\
     1.6  		--infodir=/usr/share/info		\
     1.7 +		--libexecdir=/usr/libexec/cyrus		\
     1.8  		--with-com_err=yes			\
     1.9  		--enable-murder				\
    1.10  		--enable-replication			\
    1.11 @@ -52,6 +53,7 @@
    1.12  genpkg_rules()
    1.13  {
    1.14  	mkdir -p $fs/usr/lib/cyrus
    1.15 +	mkdir -p $fs/usr/libexec
    1.16  	mkdir -p $fs/var/imap
    1.17  	mkdir -p $fs/var/spool/imap/stage.
    1.18  
    1.19 @@ -59,6 +61,9 @@
    1.20  	cp -a $install/usr/lib/libcyrus*.so*	$fs/usr/lib
    1.21  	cp -a $install/usr/lib/perl5		$fs/usr/lib
    1.22  	strip -s				$fs/usr/lib/lib*
    1.23 +	cp -a $install/usr/libexec/cyrus	$fs/usr/libexec
    1.24 +	cp -a $install/usr/sbin			$fs/usr
    1.25 +
    1.26  	cp $src/tools/mkimap			$fs/usr/lib/cyrus
    1.27  	cp -a $stuff/etc			$fs
    1.28  	cp $src/doc/examples/cyrus_conf/small.conf \
    1.29 @@ -140,7 +145,7 @@
    1.30  	  do
    1.31  		echo "createmailbox user.$i"
    1.32  	  done | chroot "$1/" cyradm -u cyrus -w cyrus 127.0.0.1 >/dev/null 2>&1
    1.33 -	chroot "$1/" su -c "/usr/lib/cyrus/bin/reconstruct" cyrus >/dev/null 2>&1
    1.34 +	chroot "$1/" su -c "/usr/sbin/reconstruct" cyrus >/dev/null 2>&1
    1.35  
    1.36  	cat <<EOF
    1.37  ----
     2.1 --- a/cyrus-imapd/stuff/etc/init.d/cyrus-imapd	Tue Feb 15 14:10:08 2022 +0100
     2.2 +++ b/cyrus-imapd/stuff/etc/init.d/cyrus-imapd	Tue Feb 15 17:13:46 2022 +0100
     2.3 @@ -1,6 +1,6 @@
     2.4  #!/bin/sh
     2.5 -# /etc/init.d/cyrus-imapd : Start, stop and restart IMAP server on SliTaz, at
     2.6 -# boot time or with the command line.
     2.7 +# /etc/init.d/cyrus-imapd : Start, stop and restart IMAP server on SliTaz,
     2.8 +# at boot time or with the command line.
     2.9  #
    2.10  # To start IMAP server at boot time, just put cyrus-imapd in the $RUN_DAEMONS
    2.11  # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
    2.12 @@ -10,95 +10,109 @@
    2.13  
    2.14  NAME=cyrus-imapd
    2.15  DESC="$(_ '%s server' IMAP)"
    2.16 -DAEMON=/usr/lib/cyrus/master
    2.17 +DAEMON=/usr/libexec/cyrus/master
    2.18  OPTIONS=$CYRUS_OPTIONS
    2.19  PIDFILE=/var/run/cyrus.master.pid
    2.20  [ -n "$OPTIONS" ] || OPTIONS="-d -p $PIDFILE"
    2.21  
    2.22  case "$1" in
    2.23 -  start)
    2.24 -    if active_pidfile $PIDFILE master ; then
    2.25 -      _ '%s is already running.' $NAME
    2.26 -      exit 1
    2.27 -    fi
    2.28 -    dir=$(grep ^configdirectory /etc/imapd.conf | awk '{print $2}')
    2.29 -    if [ ! -f $dir/mailboxes.db ]; then
    2.30 -      action 'Initialize %s...' "$DESC"
    2.31 -      #/usr/cyrus/bin/mkimap
    2.32 -      for i in db proc socket log msg user quota; do
    2.33 -        [ -d $dir/$i ] || mkdir -p -m 700 $dir/$i
    2.34 -      done
    2.35 -      for i in user quota ; do
    2.36 -        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
    2.37 -          [ -d $dir/$i/$j ] || mkdir -p $dir/$i/$j
    2.38 -        done
    2.39 -      done
    2.40 -      chown -R cyrus:mail $dir
    2.41 -      chmod 750 $dir $dir/socket
    2.42 -      for i in $(grep ^partition /etc/imapd.conf | awk '{ print $2 }') ; do
    2.43 -        [ -d $i ] || mkdir -p -m 750 $i
    2.44 -        case "$(grep ^hashimapspool /etc/imapd.conf | awk '{ print $2 }')" in
    2.45 -        y*|t*|1|on)
    2.46 -          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
    2.47 -            [ -d $i/$j ] || mkdir -p $i/$j
    2.48 -          done ;;
    2.49 -        esac
    2.50 -        [ -d $i/stage. ] || mkdir $i/stage.
    2.51 -        chown -R cyrus:mail $i
    2.52 -      done
    2.53 -      case "$(grep ^sieveusehomedir /etc/imapd.conf | awk '{ print $2 }')" in
    2.54 -      y*|t*|1|on)
    2.55 -        sieve=$(grep ^sievedir /etc/sieve | awk '{ print $2 }')
    2.56 -        [ -d $sieve ] || mkdir $sieve
    2.57 -        chmod 755 $sieve
    2.58 -        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
    2.59 -          [ -d $sieve/$j ] || mkdir -p -m 755 $sieve/$j
    2.60 -        done
    2.61 -        chown -R cyrus:mail $sieve ;;
    2.62 -      esac
    2.63 -      su cyrus -c "/usr/cyrus/bin/ctl_cyrusdb -r"
    2.64 -      su cyrus -c "/usr/cyrus/bin/reconstruct"
    2.65 -      status
    2.66 -    fi
    2.67 -    if ! pidof saslauthd >/dev/null; then
    2.68 -      /etc/init.d/cyrus-sasl start
    2.69 -    fi
    2.70 -    action 'Starting %s: %s...' "$DESC" $NAME
    2.71 -    $DAEMON $OPTIONS
    2.72 -    status
    2.73 -    sleep 2
    2.74 -    ;;
    2.75 -  stop)
    2.76 -    if ! active_pidfile $PIDFILE master ; then
    2.77 -      _ '%s is not running.' $NAME
    2.78 -      exit 1
    2.79 -    fi
    2.80 -    action 'Stopping %s: %s...' "$DESC" $NAME
    2.81 -    kill $(cat $PIDFILE)
    2.82 -    ps x | grep -q $(cat $PIDFILE) || rm -f $PIDFILE
    2.83 -    status
    2.84 -    ;;
    2.85 -  restart)
    2.86 -    if ! active_pidfile $PIDFILE master ; then
    2.87 -      _ '%s is not running.' $NAME
    2.88 -      exit 1
    2.89 -    fi
    2.90 -    action 'Restarting %s: %s...' "$DESC" $NAME
    2.91 -    kill $(cat $PIDFILE)
    2.92 -    if ps x | grep -q $(cat $PIDFILE); then
    2.93 -      false
    2.94 -    else
    2.95 -      rm -f $PIDFILE
    2.96 -      sleep 2
    2.97 -      $DAEMON $OPTIONS
    2.98 -    fi
    2.99 -    status
   2.100 -    ;;
   2.101 -  *)
   2.102 -    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
   2.103 -    newline
   2.104 -    exit 1
   2.105 -    ;;
   2.106 +	(start)
   2.107 +		if active_pidfile $PIDFILE master
   2.108 +		  then
   2.109 +			_ '%s is already running.' $NAME
   2.110 +			exit 1
   2.111 +		fi
   2.112 +		dir=$(grep ^configdirectory /etc/imapd.conf | awk '{print $2}')
   2.113 +		if [ ! -f $dir/mailboxes.db ]
   2.114 +		  then
   2.115 +			action 'Initialize %s...' "$DESC"
   2.116 +			#/usr/cyrus/bin/mkimap
   2.117 +			for i in db proc socket log msg user quota
   2.118 +			  do
   2.119 +				[ -d $dir/$i ] || mkdir -p -m 700 $dir/$i
   2.120 +			  done
   2.121 +			for i in user quota
   2.122 +			  do
   2.123 +				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
   2.124 +				  do
   2.125 +					[ -d $dir/$i/$j ] || mkdir -p $dir/$i/$j
   2.126 +				  done
   2.127 +			  done
   2.128 +			chown -R cyrus:mail $dir
   2.129 +			chmod 750 $dir $dir/socket
   2.130 +			for i in $(grep ^partition /etc/imapd.conf | awk '{ print $2 }')
   2.131 +			  do
   2.132 +				[ -d $i ] || mkdir -p -m 750 $i
   2.133 +				case "$(grep ^hashimapspool /etc/imapd.conf | awk '{ print $2 }')" in
   2.134 +					(y*|t*|1|on)
   2.135 +						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
   2.136 +						  do
   2.137 +							[ -d $i/$j ] || mkdir -p $i/$j
   2.138 +						  done
   2.139 +						;;
   2.140 +				esac
   2.141 +				[ -d $i/stage. ] || mkdir $i/stage.
   2.142 +				chown -R cyrus:mail $i
   2.143 +			  done
   2.144 +			case "$(grep ^sieveusehomedir /etc/imapd.conf | awk '{ print $2 }')" in
   2.145 +				(y*|t*|1|on)
   2.146 +					sieve=$(grep ^sievedir /etc/sieve | awk '{ print $2 }')
   2.147 +					[ -d $sieve ] || mkdir $sieve
   2.148 +					chmod 755 $sieve
   2.149 +					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
   2.150 +					  do
   2.151 +						[ -d $sieve/$j ] || mkdir -p -m 755 $sieve/$j
   2.152 +					  done
   2.153 +					chown -R cyrus:mail $sieve
   2.154 +					;;
   2.155 +			esac
   2.156 +			su cyrus -c "/usr/sbin/ctl_cyrusdb -r"
   2.157 +			su cyrus -c "/usr/sbin/reconstruct"
   2.158 +			status
   2.159 +		fi
   2.160 +		if ! pidof saslauthd >/dev/null
   2.161 +		  then
   2.162 +			/etc/init.d/cyrus-sasl start
   2.163 +		fi
   2.164 +		action 'Starting %s: %s...' "$DESC" $NAME
   2.165 +		$DAEMON $OPTIONS
   2.166 +		status
   2.167 +		sleep 2
   2.168 +		;;
   2.169 +	(stop)
   2.170 +		if ! active_pidfile $PIDFILE master
   2.171 +		  then
   2.172 +			_ '%s is not running.' $NAME
   2.173 +			exit 1
   2.174 +		fi
   2.175 +		action 'Stopping %s: %s...' "$DESC" $NAME
   2.176 +		kill $(cat $PIDFILE)
   2.177 +		ps x | grep -q $(cat $PIDFILE) || rm -f $PIDFILE
   2.178 +		status
   2.179 +		;;
   2.180 +	(restart)
   2.181 +		if ! active_pidfile $PIDFILE master
   2.182 +		  then
   2.183 +			_ '%s is not running.' $NAME
   2.184 +			exit 1
   2.185 +		fi
   2.186 +		action 'Restarting %s: %s...' "$DESC" $NAME
   2.187 +		kill $(cat $PIDFILE)
   2.188 +		if ps x | grep -q $(cat $PIDFILE)
   2.189 +		  then
   2.190 +			false
   2.191 +		  else
   2.192 +			rm -f $PIDFILE
   2.193 +			sleep 2
   2.194 +			$DAEMON $OPTIONS
   2.195 +		fi
   2.196 +		status
   2.197 +		;;
   2.198 +	(*)
   2.199 +		emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
   2.200 +		newline
   2.201 +		exit 1
   2.202 +		;;
   2.203  esac
   2.204  
   2.205  exit 0