-
Bug
-
Resolution: Done
-
Critical
-
JWS 3.0.1 DR1, JWS 3.0.1 DR2, JWS 3.0.1 ER1
-
None
-
User Experience
-
-
-
-
-
-
Similarly to the JWS-153 Numerous inconsistencies and user experience issues with Solaris Apache HTTP Server .postinstall.httpd, there are severe issues with .postinstall.tomcat on Solaris.
Some of the selected notes:
- it requires root privileges and exits without them; there is no reason for such behaviour and we should provide a fall-back alternative, customer case 01454946
- it does not check whether it had been executed before (i.e. no check for $INSTALL_ROOT/etc/.postinstall.tomcat.done
- it contains unnecessary differences between 32bit and 64bit versions
- Tomcat8 and Tomcat7 code is copy-pasted, one below the other instead of looping over [tomcat7, tomcat8] and reusing the same block of code
- jar version dependent symlinks
Suggested improvement
This is a drop-in replacement for: .postinstall.tomcat. Please, have a look at it, review the code and use it, if possible.
THX
Output from an unprivileged execution:
[hudson@dev32-02 etc]$ ./.postinstall.tomcat WARNING: This script should be run as superuser to create user `tomcat' and directories in `/var/'. WARNING: Using different root directory then `/opt/jws-3.0' WARNING: Not a superuser. User and group `tomcat' will not be created. User `hudson' used instead. WARNING: Not a superuser. Directories in `/var/' will not be created. Using `/tmp/delete/jws-3.0/var/' instead. Adding JAVA_HOME=/qa/tools/opt/solaris11_sparc/jdk1.8.0_last to the configuration ... WARNING: Not a superuser. User `hudson' used as TOMCAT_USER in /tmp/delete/jws-3.0/etc/sysconfig/tomcat7. Preserving file: /tmp/delete/jws-3.0/etc/sysconfig/tomcat7 Adding JAVA_HOME=/qa/tools/opt/solaris11_sparc/jdk1.8.0_last to the configuration ... WARNING: Not a superuser. User `hudson' used as TOMCAT_USER in /tmp/delete/jws-3.0/etc/sysconfig/tomcat8. Preserving file: /tmp/delete/jws-3.0/etc/sysconfig/tomcat8 WARNING: Not a superuser. Solaris runtime linker environment `crle' was not updated. Done
User is clearly informed about what's going on and why, what are the implications of executing the script as a non-root user and so on.