Page 1 of 1

zmdc: FAT [Can't bind: Address already in use]

Posted: Sun Nov 19, 2006 6:36 am
by anest
tail /var/log/messages
Nov 19 09:22:16 localhost zmdc[7260]: INF ['zmupdate.pl -c' started at 06/11/19 09:22:16]
Nov 19 09:22:16 localhost Update agent starting at 06/11/19 09:22:16
Nov 19 09:23:42 localhost zmpkg[7298]: INF [Command: start]
Nov 19 09:23:42 localhost zmdc[7310]: INF [Server starting at 06/11/19 09:23:42]
Nov 19 09:23:44 localhost zmdc[7310]: FAT [Can't bind: Address already in use]
Nov 19 09:23:44 localhost Can't bind: Address already in use at /usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Debug.pm line 321
Nov 19 09:23:44 localhost ZoneMinder::Debug::Fatal('Can\'t bind: Address already in use') called at /usr/bin/zmdc.pl line 166
Nov 19 09:23:52 localhost zmdc[7308]: FAT [Can't connect: Permission denied]
Nov 19 09:23:52 localhost zmpkg[7298]: ERR [Unable to run "/usr/bin/zmdc.pl startup", output is "Starting server"]
Nov 19 09:25:01 localhost cron[7360]: (root) CMD (php /var/www/localhost/htdocs/cacti/poller.php > /dev/null 2>&1)
Why?
ps: all installed from source with:
./configure --with-webdir=/var/www/localhost/htdocs --with-cgidir=/var/www/localhost/cgi-bin --with-webgroup=apache --with-webuser=apache --with-mysql=/usr --with-libarch=lib --with-ffmpeg=/usr --disable-debug --disable-crashtrace --prefix=/usr --sysconfdir=/etc ZM_DB_HOST=localhost

Posted: Mon Nov 20, 2006 10:54 pm
by zoneminder
Your error often means that you have run zmdc.pl as root to test. It has then created it's socket file as /tmp/zmdc.sock. When you then run it as apache, it does not have permissions to use that socket file. Check what .sock files are in /tmp anyway, and who owns them.

Posted: Mon Nov 20, 2006 11:06 pm
by anest
Thank you!

Posted: Mon Dec 29, 2008 12:54 am
by d0t101101
Running Ubuntu Hardy, and had lots of difficulty getting my IP PTZ camera control working. This pointed me in the right direction.

For anyone else experiencing this error (Can't bind: Address already in use), here is the command to correct the permissions in Debian based distros only. The filename might be different on your setup:

sudo chown www-data.www-data /tmp/zmcontrol-1.sock

Idea - maybe 'zmfix -a' should verify/correct these file permissions automatically...

Best regards,
.