Unable to find valid 'su' syntax

Support and queries relating to all previous versions of ZoneMinder
Locked
ioclaudio
Posts: 15
Joined: Tue Jul 29, 2008 10:49 pm

Unable to find valid 'su' syntax

Post by ioclaudio »

Hi all,
I've installed ZoneMinder 1.23.3 on an Ubuntu server.

But if I try to start the system clicking on Stopped-->ZoneMinder - Run State-->Apply the server doesn't start and in the syslog file I can see this error:

Aug 26 18:34:11 argo zmpkg[21181]: INF [Command: start]
Aug 26 18:34:11 argo zmpkg[21181]: ERR [Unable to find valid 'su' syntax 'su root -c 'true'' ]

To show better the message error I have modified the line 304 of the file zmpkg.pl from
Error( "Unable to find valid 'su' syntax \n" );
to
Error( "Unable to find valid 'su' syntax '$command' \n" );

Which is the problem according to you?

c.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Do you have sudo installed?
ioclaudio
Posts: 15
Joined: Tue Jul 29, 2008 10:49 pm

Post by ioclaudio »

cordel wrote:Do you have sudo installed?
Yes, I have.
claudio@argo:/var/www$ dpkg -l sudo
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Nome Versione Descrizione
+++-=================================-=================================-==================================================================================
ii sudo 1.6.9p10-1ubuntu3.2 Provide limited super user privileges to specific users

c.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Oops, I missed the part in your error.
It's invalid to su to root.
You have to configure zm to run as your Apache user as described in the documentation.
ioclaudio
Posts: 15
Joined: Tue Jul 29, 2008 10:49 pm

Post by ioclaudio »

Yes, thank you, running zm with the apache user (www-data) it starts.

c.
maumar
Posts: 3
Joined: Mon Sep 15, 2008 10:29 am

Post by maumar »

sorry claudio, i am not able to find in docs how to configure zm to run as your Apache user

i have your same issue Unable to find valid 'su' syntax

byez

Maurizio
ioclaudio
Posts: 15
Joined: Tue Jul 29, 2008 10:49 pm

Post by ioclaudio »

It is an option of the configure utility.

./configure --with-webdir=... --with-cgidir=... --with-webuser=www-data --with-webgroup=www-data

I remember well these data are written in the file zm.conf, but now I haven't the pc with ZM installed and I can't check it.

cld
maumar
Posts: 3
Joined: Mon Sep 15, 2008 10:29 am

Post by maumar »

i have already used them with no luck
they say only that apache wil run with user apache and group apache
they do not tell to zm how it should run as

my /usr/local/etc/zm.conf is :
# Current version of ZoneMinder
ZM_VERSION=1.23.3

# Path to build directory, used mostly for finding DB upgrade scripts
ZM_PATH_BUILD=/root/ZoneMinder-1.23.3

# Build time, used to record when to trigger various checks
ZM_TIME_BUILD=1221493562

# Path to ZoneMinder binaries
ZM_PATH_BIN=/usr/local/bin

# Path to ZoneMinder libraries (none at present, for future use)
ZM_PATH_LIB=/usr/local/lib

# Path to ZoneMinder configuration (this file only at present)
ZM_PATH_CONF=/usr/local/etc

# Path to ZoneMinder web files
ZM_PATH_WEB=/var/www/html/zm

# Path to ZoneMinder cgi files
ZM_PATH_CGI=/var/www/cgi-bin

# Username and group that web daemon (httpd/apache) runs as
ZM_WEB_USER=apache
ZM_WEB_GROUP=apache

# ZoneMinder database hostname or ip address
ZM_DB_HOST=localhost

# ZoneMinder database name
ZM_DB_NAME=zm

# ZoneMinder database user
ZM_DB_USER=zmuser

# ZoneMinder database password
ZM_DB_PASS=zmpass

as u see:
# Username and group that web daemon (httpd/apache) runs as
ZM_WEB_USER=apache
ZM_WEB_GROUP=apache

is is not enough to avoid:
Sep 15 17:52:53 elastix zmpkg[26151]: INF [Command: start]
Sep 15 17:52:55 elastix zmpkg[26151]: ERR [Unable to find valid 'su' syntax]
maumar
Posts: 3
Joined: Mon Sep 15, 2008 10:29 am

Post by maumar »

Claudio,
i was completely wrong, i am using an elastix box and httpd runs as asterisk user, reading zmpkg.pl has lighted me
using asterisk user as ZM_WEB_USER and ZM_WEB_GROUP fixed the issue

thnx
Locked