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

Support and queries relating to all previous versions of ZoneMinder
Locked
anest
Posts: 24
Joined: Tue May 16, 2006 12:47 am

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

Post 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
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post 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.
Phil
anest
Posts: 24
Joined: Tue May 16, 2006 12:47 am

Post by anest »

Thank you!
d0t101101
Posts: 14
Joined: Mon Dec 24, 2007 9:49 pm

Post 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,
.
Locked