[csw-devel] SF.net SVN: gar:[11194] csw/mgar/pkg/apache2/trunk/files/CSWapache2. postinstall

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Fri Oct 8 03:59:43 CEST 2010


Revision: 11194
          http://gar.svn.sourceforge.net/gar/?rev=11194&view=rev
Author:   bdwalton
Date:     2010-10-08 01:59:42 +0000 (Fri, 08 Oct 2010)

Log Message:
-----------
apache2: generate a dummy ssl cert if required so that mod_ssl doesn't prevent startup in fresh install

Modified Paths:
--------------
    csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall

Modified: csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall
===================================================================
--- csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall	2010-10-07 15:16:10 UTC (rev 11193)
+++ csw/mgar/pkg/apache2/trunk/files/CSWapache2.postinstall	2010-10-08 01:59:42 UTC (rev 11194)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
-CSW_PREFIX=${PKG_INSTALL_ROOT}/opt/csw
+ROOT=${PKG_INSTALL_ROOT:-/}
+CSW_PREFIX=${ROOT}/opt/csw
 AP2_PREFIX=$CSW_PREFIX/apache2
 AP2_BINDIR=$AP2_PREFIX/sbin
 AP2_LIBEXEC=$AP2_PREFIX/libexec
@@ -72,4 +73,9 @@
     fi
 done
 
+if [ ! -f $AP2_CONFDIR/server.crt -a ! -f $AP2_CONFDIR/server.key ]; then
+    echo Generating dummy ssl key and certificate...
+    chroot ${ROOT} perl -e 'print "TS\nWestfarthing\nHobbiton\n\n\nBilbo Baggins\nbilbo at example.net\n\n\n";' | chroot ${ROOT} openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout /opt/csw/apache2/etc/server.key  -out /opt/csw/apache2/etc/server.crt >/dev/null 2>&1
+fi
+
 exit 0


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list