Bug 1121949 - Syntax error in .postinstall.httpd
Summary: Syntax error in .postinstall.httpd
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Apache Server (httpd) and Connectors
Version: 6.3.0
Hardware: Unspecified
OS: Solaris
Target Milestone: ER10
: EAP 6.3.0
Assignee: Vaclav Tunka
QA Contact: Jan Stefl
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-22 08:28 UTC by Jan Stefl
Modified: 2017-10-10 00:10 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-08-06 14:36:58 UTC
Type: Bug

Attachments (Terms of Use)

Description Jan Stefl 2014-07-22 08:28:53 UTC
sudo sh .postinstall.httpd produces:

Apache group (id=48) already exists.
Apache user  (id=48) already exists.
.postinstall.httpd: line 190: syntax error at line 243: `do' unexpected

Problem manifests on Solaris.

Comment 1 Mladen Turk 2014-07-22 09:07:21 UTC
Tested on my local VM
SunOS ss10x64v0 5.10 Generic_147441-01 i86pc i386 i86pc Solaris

bash-3.2$ sudo unzip -q /mnt/sf_shared/Downloads/jboss-ews-httpd-2.1.0-12.sun10.x86_64.zip
bash-3.2$ cd jboss-ews-2.1/etc/
bash-3.2$ sudo ./.postinstall.httpd
Apache group (id=48) created.
Apache user  (id=48) created.
Generating private RSA key ... OK
Generating new ss10x64v0 certificate ... OK

It works without anz problems

Comment 2 Mladen Turk 2014-07-22 09:08:46 UTC
Second invocation gives

bash-3.2$ sudo ./.postinstall.httpd
Apache group (id=48) already exists.
Apache user  (id=48) already exists.
Preserving file: ssl.conf
Preserving file: welcome.conf
Preserving file: manual.conf
Preserving file: proxy_ajp.conf
Preserving file: mod_cluster.conf
Preserving file: /opt/jboss-ews-2.1/etc/httpd/conf/httpd.conf
Preserving file: /opt/jboss-ews-2.1/etc/mime.types
Preserving file: /opt/jboss-ews-2.1/etc/sysconfig/httpd
Preserving file: /opt/jboss-ews-2.1/etc/logrotate.d/httpd
Preserving file: /opt/jboss-ews-2.1/var/www/error/noindex.html
Preserving file: /opt/jboss-ews-2.1/sbin/apachectl

Comment 4 Mladen Turk 2014-07-22 10:25:40 UTC
This is probably bug in agregate package because this line is not commentented in the origin jboss-ews-httpd-2.1.0 zip file. Vaclav, any idea why such thing happen?

Comment 5 Vaclav Tunka 2014-07-22 13:58:57 UTC
Mladen, this is the culprit from jboss-eap6-httpd-natives package:
unzip $i jboss-ews-2.*/etc/.postinstall.httpd
sed -i -e '/mod_cluster/ s/^/# /' -e '/mod_snmp/ s/^/# /'  jboss-ews-2.*/etc/.postinstall.httpd
zip -u $i jboss-ews-2.*/etc/.postinstall.httpd
rm -fr jboss-ews-2.*/etc/.postinstall.httpd

JBPAPP-9993 was renamed to JBPAPP6-1091

Comment 8 Vaclav Tunka 2014-07-22 19:53:29 UTC
Available in ER10.2 compose

Comment 9 Michal Karm Babacek 2014-07-22 23:41:37 UTC
 - postinstall executes, that's good - Apache HTTP Server starts on Solaris
 - there are errors alarming to the user

Full report:
I apologise if I'm looking at a wrong zip [1], but I can't help it but to see that the postinstall on Solaris is still somewhat ill. One could verify it simply by

1 - unzip
2 - execute

> sed: Cannot open file mod_cluster.conf.in.

What's wrong (Solaris postinstall) - looking for, now gone, mod_cluster.conf

240     # Copy .in files preserving existing
241     cd "$INSTALL_ROOT/etc/httpd/conf.d"
242     for f in ssl.conf welcome.conf manual.conf proxy_ajp.conf mod_cluster.conf
243     do
244         copynoreplace $f
245     done

Windows postinstall also tries to reach the non-existent file:

> The process tried to write to a nonexistent pipe.

An excerpt from the Windows postinstall:

69 for %%i in (manual.conf mod_cluster.conf proxy_ajp.conf ssl.conf welcome.conf) do (
70     if not exist %%i nawk -f "%INSTALL_ETC_DIR%\rewriteconf.awk" "%INSTALL_TOP_DIR%" %%i.in %%i
71 )

Note that there are mod_cluster.conf files mentioned in RHEL postinstall scripts as well, but these are harmless, because they are conditional, i.e. as in if [ -f 'conf.d/mod_cluster.conf' ]; then ...


[1] sha256 ea5e053708d23147a6f60475e5169cd6ac6253bb96d903a6c5e4d0bfc44a6d72 jboss-ews-httpd-2.1.0-sun10.sparc64.zip, 22-Jul-2014 15:36, from the candidates repo.
sha256 11afa017cd3a0e9dc0cc845d68a4cc50fcab170fb3e0ae2f6f6669fcfbddc915 jboss-ews-httpd-2.1.0-win6.i686.zip

@Jan Stefl: You might want to treat this as a separate bugzilla. I'm leaving it up to you since you are the reporter.

Comment 10 Mladen Turk 2014-07-23 06:11:37 UTC
I do not understand the latest comment #9.
What do you mean by

Windows postinstall also tries to reach the non-existent file:

> The process tried to write to a nonexistent pipe.

I tested the postinstall.httpd.bat and there are no errors reported.
Might be again some hacking the scricpts in aggregate packages. Vaclav are
you changing something later on?

Comment 11 Jean-frederic Clere 2014-07-23 07:01:01 UTC
pushd httpd\conf.d
for %%i in (manual.conf mod_cluster.conf proxy_ajp.conf ssl.conf welcome.conf) do (
    if not exist %%i nawk -f "%INSTALL_ETC_DIR%\rewriteconf.awk" "%INSTALL_TOP_DIR%" %%i.in %%i
Won't that try to create a mod_cluster.conf even there isn't a mod_cluster.conf.in

Comment 19 Vaclav Tunka 2014-07-23 11:56:42 UTC
More complete fix available in ER10.3 compose

Comment 20 Jan Stefl 2014-07-24 15:27:52 UTC
Both issues with postinstall scripts were fixed.

Verified on 6.3.0.ER10.3

Note You need to log in before you can comment on or make changes to this bug.