zmpkg.pl and su

Support and queries relating to all previous versions of ZoneMinder
Locked
mopo
Posts: 1
Joined: Fri Dec 02, 2005 9:41 am

zmpkg.pl and su

Post by mopo »

I'm using gentoo 2005.1 and I have tried using the gentoo package and the source tarball and I have come across this problem on both instances.
livserve zoneminder # cat zmpkg.log
Command: start
Executing: su apache --shell=/bin/sh --command='/usr/local/bin/zmdc.pl check'
/bin/bash: --shell=/bin/sh: invalid option
Usage: /bin/bash [GNU long option] [option] ...
/bin/bash [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
line 157 in zmpkg.pl is

Code: Select all

$command = "su ".ZM_WEB_USER." --shell=/bin/sh --command='$command'";
I fixed it by changing it to

Code: Select all

 
$command = "su -c '$command' ".ZM_WEB_USER."";
This happened with both versions I tried the one in the portage tree 1.21.3 and 1.21.4 the source tarball I used.[/code]
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Yes, this is a known issue. If anyone can suggest a way of telling what the acceptable syntax on any particular machine is I will change it to be automatic.

Phil
Locked