New install on Ubuntu 16.04, service only partially starts?

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
wearysky
Posts: 5
Joined: Sat Mar 07, 2020 8:43 pm

New install on Ubuntu 16.04, service only partially starts?

Post by wearysky » Sun Mar 08, 2020 6:09 pm

Ok, so I've been googling for some time trying to see if anybody else has encountered something similar, but can't seem to find anything. I've got a fresh install (installed from the script on this page: https://wiki.zoneminder.com/Ubuntu_Serv ... ell_script ), got into the console on the web and tried adding a camera, and it seems like everything is working correctly in my initial testing (I'm able to add my iCamera 1000 via ffmpeg type, and see its feed), but I noticed that the zoneminder service is reporting in its status that it failed to start. Here's the journalctl log:

Code: Select all

Mar 07 15:37:04 snarfbuntu systemd[1]: Starting ZoneMinder CCTV recording and surveillance system...
Mar 07 15:37:04 snarfbuntu zmpkg[6633]: INF [Sanity checking States table...]
Mar 07 15:37:04 snarfbuntu zmpkg[6633]: INF [Command: start]
Mar 07 15:37:04 snarfbuntu sudo[6653]:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/bin/true
Mar 07 15:37:04 snarfbuntu sudo[6653]: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Mar 07 15:37:04 snarfbuntu sudo[6657]:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/usr/bin/zmdc.pl check
Mar 07 15:37:04 snarfbuntu sudo[6657]: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Mar 07 15:37:04 snarfbuntu sudo[6661]:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/usr/bin/zmdc.pl startup
Mar 07 15:37:04 snarfbuntu sudo[6661]: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Mar 07 15:37:06 snarfbuntu zmpkg[6633]: INF [Single server configuration detected. Starting up services.]
Mar 07 15:37:06 snarfbuntu sudo[6692]:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/usr/bin/zmdc.pl start zmfilter.pl --filter_id=1 --daemon
Mar 07 15:37:06 snarfbuntu sudo[6692]: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Mar 07 15:37:06 snarfbuntu sudo[6696]:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/usr/bin/zmdc.pl start zmfilter.pl --filter_id=2 --daemon
Mar 07 15:37:06 snarfbuntu sudo[6696]: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Mar 07 15:37:06 snarfbuntu sudo[6701]:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/usr/bin/zmdc.pl start zmwatch.pl
Mar 07 15:37:06 snarfbuntu sudo[6701]: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Mar 07 15:37:06 snarfbuntu sudo[6707]:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/usr/bin/zmdc.pl start zmupdate.pl -c
Mar 07 15:37:06 snarfbuntu sudo[6707]: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Mar 07 15:37:06 snarfbuntu sudo[6713]:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/usr/bin/zmdc.pl start zmtelemetry.pl
Mar 07 15:37:06 snarfbuntu sudo[6713]: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Mar 07 15:37:07 snarfbuntu sudo[6717]:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/usr/bin/zmdc.pl start zmstats.pl
Mar 07 15:37:07 snarfbuntu sudo[6717]: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Mar 07 15:37:07 snarfbuntu systemd[1]: zoneminder.service: New main PID 6664 does not belong to service, and PID file is not owned by root. Refusing.
Mar 07 15:37:07 snarfbuntu systemd[1]: zoneminder.service: New main PID 6664 does not belong to service, and PID file is not owned by root. Refusing.
Mar 07 15:37:07 snarfbuntu systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system.
Mar 07 15:37:07 snarfbuntu systemd[1]: zoneminder.service: Unit entered failed state.
Mar 07 15:37:07 snarfbuntu systemd[1]: zoneminder.service: Failed with result 'resources'.
And doing a quick ps -A | grep zm, I see the following processes:

Code: Select all

25275 ?        00:00:00 zmdc.pl
25304 ?        00:00:02 zmc
25308 ?        00:00:00 zmfilter.pl
25313 ?        00:00:00 zmfilter.pl
25319 ?        00:00:00 zmtrigger.pl
25325 ?        00:00:00 zmwatch.pl
25331 ?        00:00:00 zmupdate.pl
25336 ?        00:00:00 zmtelemetry.pl
25342 ?        00:00:00 zmstats.pl
So a couple questions:

1 - is this going to cause me some issues that I haven't yet discovered?
2 - anybody ever encounter it, and know how to fix it?

User avatar
Bluemax
Posts: 105
Joined: Wed Jun 12, 2019 5:15 pm

Re: New install on Ubuntu 16.04, service only partially starts?

Post by Bluemax » Sun Mar 08, 2020 7:26 pm

I would start by looking up /etc/init.d/zoneminder to see where these lines are generated and why the PID owners do not match.

Code: Select all

Mar 07 15:37:07 snarfbuntu systemd[1]: zoneminder.service: New main PID 6664 does not belong to service, and PID file is not owned by root. Refusing.
Mar 07 15:37:07 snarfbuntu systemd[1]: zoneminder.service: New main PID 6664 does not belong to service, and PID file is not owned by root. Refusing.

bbunge
Posts: 2719
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: New install on Ubuntu 16.04, service only partially starts?

Post by bbunge » Sun Mar 08, 2020 8:13 pm


wearysky
Posts: 5
Joined: Sat Mar 07, 2020 8:43 pm

Re: New install on Ubuntu 16.04, service only partially starts?

Post by wearysky » Mon Mar 09, 2020 12:02 am

Bluemax wrote:
Sun Mar 08, 2020 7:26 pm
I would start by looking up /etc/init.d/zoneminder to see where these lines are generated and why the PID owners do not match.
Those lines are generated by systemd... I threw some debugging lines into zmpkg.pl - everything seems to be starting up ok, the returnval from the perl script is 0.
bbunge wrote:
Sun Mar 08, 2020 8:13 pm
Look at this: viewtopic.php?f=40&t=29149
That issue appears to have been a problem due to an upgrade. I took a look at my config files just to make sure, but no issues in my install with ZM_PATH_SOCKS that I can see.

A quick call to "sudo su -s/bin/bash -c"/usr/bin/zmdc.pl check" www-data" returns "running", which seems to explain

Removing the PIDfile line from /lib/systemd/system/zoneminder.service eliminates the error (but then things really break within zoneminder itself)
Last edited by wearysky on Mon Mar 09, 2020 2:06 am, edited 1 time in total.

User avatar
Bluemax
Posts: 105
Joined: Wed Jun 12, 2019 5:15 pm

Re: New install on Ubuntu 16.04, service only partially starts?

Post by Bluemax » Mon Mar 09, 2020 12:28 am

Please post this outputs:
ps ax --format uname,group,pid,ppid,tty,cmd > /tmp/ps.txt
systemctl status zoneminder.service > /tmp/zoneminder_service.txt

bbunge
Posts: 2719
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: New install on Ubuntu 16.04, service only partially starts?

Post by bbunge » Mon Mar 09, 2020 1:10 am

Loaded up a fresh 16.04 minimal server with Apache2 and Mariadb-server. Did find one error in the script (the original Zoneminder ppa does not exist but the files needed from there have been moved to the Zoneminder-1.34 ppa).
Added my test camera and checked the logs. Had to set the timezone in Options. No other errors. System running well.
Bionic may be a better option for you.....

wearysky
Posts: 5
Joined: Sat Mar 07, 2020 8:43 pm

Re: New install on Ubuntu 16.04, service only partially starts?

Post by wearysky » Mon Mar 09, 2020 2:44 am

Yeah, I removed the original zoneminder PPA from the script. Otherwise I barely touched it. So weird. I just wanted a simple setup to easily trigger a recording on my camera from SmartThings events. Turned into a whole process, now the wife says it's too unreliable blah blah blah, lol

bbunge
Posts: 2719
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: New install on Ubuntu 16.04, service only partially starts?

Post by bbunge » Mon Mar 09, 2020 8:30 pm

When I install Ubuntu or Debian I use the mini net boot image and install a very minimal server. Openssh server is about the only program I add at install so I can connect from another pc to finish the system. Lately I have been using a ssd for "/" and add a hd at install for zmstore. I install LAMP mostly with Mariadb server then Zoneminder from my script.

wearysky
Posts: 5
Joined: Sat Mar 07, 2020 8:43 pm

Re: New install on Ubuntu 16.04, service only partially starts?

Post by wearysky » Mon Mar 09, 2020 8:48 pm

Well, this was me adding ZoneMinder to an existing Ubuntu box (currently serving as my Sonarr/Radarr/Plex/OpenVPN machine). i've never encountered this kind of issue before though so it's got me pretty stumped.

wearysky
Posts: 5
Joined: Sat Mar 07, 2020 8:43 pm

Re: New install on Ubuntu 16.04, service only partially starts?

Post by wearysky » Tue Mar 10, 2020 2:47 pm

Update: couldn't find a solution, so I just set it up as a docker container and am running it that way. All seems to be working well.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest