debian/littlebird-tc-core.postinst
changeset 118 aa280f39150b
parent 116 865ca85cbf5b
equal deleted inserted replaced
117:e489aabf88e4 118:aa280f39150b
    22 trap "rm -f $tmp" EXIT INT QUIT TERM
    22 trap "rm -f $tmp" EXIT INT QUIT TERM
    23 
    23 
    24 case "$1" in
    24 case "$1" in
    25     configure)
    25     configure)
    26 
    26 
    27     dirs="/var/log/littlebird-tc /var/lib/littlebird-tc/CA /var/lib/littlebird-tc/data"
    27     # some of these dirs may not be installed (notably /var/logs seems
    28     chgrp -R www-data $dirs
    28     # not to be installed anymore (told me by Stefan Kögel - 2012-02-15)
    29     chmod -R g+w $dirs
    29     for dir in /var/log/littlebird-tc /var/lib/littlebird-tc/CA /var/lib/littlebird-tc/data
       
    30     do
       
    31 	test -d "$dir" && chgrp -R www-data $dir
       
    32 	test -d "$dir" && chmod -R g+w $dir
       
    33     done
    30 
    34 
    31     # Timezone in /usr/local/zend/etc/php.ini
    35     # Timezone in /usr/local/zend/etc/php.ini
    32     # note: this file is handled as a conffile under ucf control
    36     # note: this file is handled as a conffile under ucf control
    33     f=/usr/local/zend/etc/php.ini
    37     f=/usr/local/zend/etc/php.ini
    34     perl -pi -e 's{^;?\s*(date\.timezone\s*=).*$}{$1 "Europe/Berlin"}' $f
    38     test -f $f \
       
    39     && perl -pi -e 's{^;?\s*(date\.timezone\s*=).*$}{$1 "Europe/Berlin"}' $f
    35 
    40 
    36     # not sure if this conforms to policy: changing another packages
    41     # not sure if this conforms to policy: changing another packages
    37     # config files
    42     # config files: if a /usr/local/zend/etc/conf.php.ini exists, we'll
       
    43     # link the "official" php.ini to this local php.ini
       
    44     # 2012-02-15: I think, it is not necessary anymore, since the
       
    45     # zend-server is not used anymore.
    38     if test -d /etc/php5/cli; then
    46     if test -d /etc/php5/cli; then
    39 	#echo "# linking php.ini to zend" >&2
    47 	#echo "# linking php.ini to zend" >&2
    40 	( set -e
    48 	( set -e
    41 	  cd /etc/php5/cli
    49 	  cd /etc/php5/cli
    42 	  s=/usr/local/zend/etc/conf.php.ini
    50 	  s=/usr/local/zend/etc/conf.php.ini
    43 	  if test `readlink -f php.ini` != `readlink -f $s`
    51 	  if test -f $s && test `readlink -f php.ini` != `readlink -f $s`
    44 	  then
    52 	  then
    45 	      rm -vf php.ini
    53 	      rm -vf php.ini
    46 	      ln -vs $s php.ini
    54 	      ln -vs $s php.ini
    47 	  fi
    55 	  fi
    48 	)
    56 	)
    53 	( set -e
    61 	( set -e
    54 	  cd /etc/php5/conf.d
    62 	  cd /etc/php5/conf.d
    55 	  for p in mysqli.ini curl.ini mcrypt.ini gd.ini
    63 	  for p in mysqli.ini curl.ini mcrypt.ini gd.ini
    56 	  do
    64 	  do
    57 	    s=/usr/local/zend/etc/conf.d/$p
    65 	    s=/usr/local/zend/etc/conf.d/$p
    58 	    if test `readlink -f $p` != `readlink -f $s`
    66 	    if test -f $s && test `readlink -f $p` != `readlink -f $s`
    59 	    then
    67 	    then
    60 		rm -vf $p
    68 		rm -vf $p
    61 		ln -vs $s .
    69 		ln -vs $s .
    62 	    fi
    70 	    fi
    63 	  done
    71 	  done
   191 	
   199 	
   192 
   200 
   193 
   201 
   194     db_stop || true
   202     db_stop || true
   195 	( . /etc/apache2/envvars
   203 	( . /etc/apache2/envvars
   196 	  invoke=`which invoke-rc.d`
   204 	  invoke=
   197 	  if ! apache2 -M 2>/dev/null | grep -q ssl_module; then
   205 	  for module in ssl rewrite; do
   198 		  a2enmod ssl
   206 	      if ! apache2 -M 2>/dev/null | grep -q ${module}_module; then
   199 		  test "$invoke" && $invoke apache2 restart >&2
   207 		      a2enmod $module
   200 	  else
   208 		      invoke=`which invoke-rc.d`
   201 		  test "$invoke" && $invoke apache2 reload >&2
   209 	      fi
   202 	  fi
   210 	   done
       
   211 	   # for ssl reload doesn't suffice, using restart we're on the
       
   212 	   # safe side
       
   213 	   test "$invoke" && $invoke apache2 restart >&2 || true
   203 	)
   214 	)
   204 
   215 
   205     ;;
   216     ;;
   206 
   217 
   207     abort-upgrade|abort-remove|abort-deconfigure)
   218     abort-upgrade|abort-remove|abort-deconfigure)