[ZBXNEXT-1889] Java gateway startup script has bad path to bash Created: 2013 Sep 05  Updated: 2014 Mar 05  Resolved: 2014 Feb 24

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Java gateway (J)
Affects Version/s: 2.0.8
Fix Version/s: 2.0.12, 2.2.3, 2.3.0

Type: Change Request Priority: Critical
Reporter: Ari Maniatis Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Ari Maniatis [ 2013 Sep 05 ]

The startup.sh script has hardcoded "/bin/bash" in two places. On some platforms (eg. FreeBSD) this isn't going to work either because bash is not always there or at a different path.

The goal here should be to rewrite this very simple script to work in plain /bin/sh.

Comment by Oleksii Zagorskyi [ 2013 Sep 09 ]

One of the point why I started to hate the FreeBSD (and dropped to use it then) it's that bash is not there by default.
I cannot imagine effective work on a server without having "/bin/bash" as a symbolic link (manually created) to actual bash binary.

Well, one my FreeBSD host is still alive:

[root@mon ~]# ls -l /bin/bash
lrwxr-xr-x  1 root  wheel  19 20 лис  2010 /bin/bash -> /usr/local/bin/bash

Also I'm much much much much more happy to use "bash" as interactive shell on FreeBSD instead of the default "sh".
Yes, I was using the "sh" as shell for some period of time, and I want to cry when I recall that.

As it's requested for server type component (Java gateway in our case) it supposed to be not a "wide" problem so I personally not very support this request.

... I'm sorry for off-topic

Comment by Ari Maniatis [ 2013 Sep 09 ]

How do I put this nicely? You are trying to tell me that an operating system sucks because your favourite shell isn't in the path you expect? Seriously?

Some people like bash. Other people tcsh or zsh or a million other things.

One of the reasons I don't use Linux is the way it mixes the core system with installed packages. FreeBSD has clean separation between the core system and packages (all in /usr/local).

The fault here is just that Zabbix assumes bash is in a certain path. Remove that assumption and all will be fine. For a trivial startup script 'sh' does just fine. What are you doing which requires bash? Or use the portable env approach.

http://en.wikipedia.org/wiki/Shebang_%28Unix%29#Portability

This is not going to be just a FreeBSD issue.

Comment by Aleksandrs Saveljevs [ 2014 Feb 24 ]

The script was adapted to work in /bin/sh under ZBX-5558. Please see that issue for more details and the current progress.

Comment by Andris Zeila [ 2014 Mar 03 ]

Successfully tested

Comment by Aleksandrs Saveljevs [ 2014 Mar 05 ]

Available in pre-2.0.12 r43228, pre-2.2.3 r43229, and pre-2.3.0 (trunk) r43230.

Generated at Thu Apr 25 23:02:41 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.