Errors after assigning bind mount to ZM container

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
ChrisNeedsGoodAdvice
Posts: 8
Joined: Fri Jul 30, 2021 10:03 pm

Errors after assigning bind mount to ZM container

Post by ChrisNeedsGoodAdvice »

Hello Community,

I'm running ZM 1.36.33 in a Ubuntu 22.04 container in Proxmox. (Not Turnkey ZoneMinder)


Basically, trying to get an additional video storage going, I added these line to:

Host

Code: Select all

mp0: /mnt/pve/ZMstore,mp=/mnt/ZoneStorage
addgroup --gid 100033 zmgroup
chgrp -R zmgroup /mnt/pve/ZMstore
chmod -R 2775 /mnt/pve/ZMstore
setfacl -Rm g:100033:rwx,d:g:100033:rwx /mnt/pve/ZMstore
and Container

Code: Select all

addgroup --gid 100033 zmgroup
usermod -aG zmgroup root


The ZoneStorage directory works now but I can't change the run state. I get this:

root@Zoneminder:/# systemctl status zoneminder
* zoneminder.service - ZoneMinder CCTV recording and surveillance system
Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Wed 2024-07-17 17:05:04 EDT; 2h 55min ago
Process: 4692 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=1/FAILURE)
CPU: 136ms

Jul 17 17:05:04 ZoneMinder systemd[1]: Stopped ZoneMinder CCTV recording and surveillance system.



If I start and stop Zoneminder from the GUI I get this even though it remains running:


root@Zoneminder:/# journalctl -xeu zoneminder.service
--
-- The job identifier is 37174.
Jul 17 17:04:55 Zoneminder sudo[4698]: root : true : Invalid argument ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=true
Jul 17 17:04:55 Zoneminder su[4700]: (to www-data) root on none
Jul 17 17:04:55 Zoneminder su[4700]: pam_unix(su:session): session opened for user www-data(uid=33) by (uid=0)
Jul 17 17:04:55 Zoneminder su[4700]: pam_unix(su:session): session closed for user www-data
Jul 17 17:04:55 Zoneminder su[4703]: (to www-data) root on none
Jul 17 17:04:55 Zoneminder su[4703]: pam_unix(su:session): session opened for user www-data(uid=33) by (uid=0)
Jul 17 17:04:55 Zoneminder su[4703]: pam_unix(su:session): session closed for user www-data
Jul 17 17:04:55 Zoneminder systemd[1]: zoneminder.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit zoneminder.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.

Jul 17 17:04:55 Zoneminder systemd[1]: zoneminder.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit zoneminder.service has entered the 'failed' state with result 'exit-code'.

Jul 17 17:04:55 Zoneminder systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system.
-- Subject: A start job for unit zoneminder.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit zoneminder.service has finished with a failure.
--
-- The job identifier is 37174 and the job result is failed.

Jul 17 17:05:04 Zoneminder systemd[1]: Stopped ZoneMinder CCTV recording and surveillance system.
-- Subject: A stop job for unit zoneminder.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A stop job for unit zoneminder.service has finished.
--
-- The job identifier is 37403 and the job result is done.



Keep in mind that even though it says Failed to start, ZoneMinder is still running and recording.
Is the problem occurring because the storage is not www-data:www-data?


root@Zoneminder:/# ls -la /mnt
total 16
drwxr-xr-x 3 root root 3 Jul 17 14:36 .
drwxr-xr-x 17 root root 23 Jul 17 16:27 ..
drwxrwsr-x+ 4 nobody www-data 4096 Jul 17 16:04 ZoneStorage

root@Zoneminder:/# ls -la /mnt/ZoneStorage
total 25
drwxrwsr-x+ 4 nobody www-data 4096 Jul 17 16:04 .
drwxr-xr-x 3 root root 3 Jul 17 14:36 ..
drwxr-sr-x+ 3 www-data www-data 4096 Jul 17 16:04 1
drwxrwsr-x+ 2 nobody www-data 16384 Jul 17 11:06 lost+found


Can somebody please offer assistance?
User avatar
iconnor
Posts: 3357
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Errors after assigning bind mount to ZM container

Post by iconnor »

Hopefully someone with more experience with proxmox can help out.

All I can say is that starting up ZM shouldn't even look at storage. That comes much later.

One of the things we do at startup is figure out if we are running under systemd and do the rights things. So we try to run "true" as www-data as a test to see if we can. That is failing.

Seems like maybe group membership for root has changed so that it can't sudo anymore? Maybe exec into the container and see if you can sudo.
ChrisNeedsGoodAdvice
Posts: 8
Joined: Fri Jul 30, 2021 10:03 pm

Re: Errors after assigning bind mount to ZM container

Post by ChrisNeedsGoodAdvice »

Thanks, I appreciate the reply.

You may be right that group membership for root has changed -- influenced by other bind mounting instructions that I followed.

This is what sudo gives me:

Code: Select all

root@Zoneminder:~# sudo
sudo: unable to set runas group vector: Invalid argument
sudo: /bin/bash: Invalid argument
For clarity sake, I know that storage ownership is supposed to be www-data:www-data, but then does this look right?

Code: Select all

root@Zoneminder:/# ls -la /mnt
total 16
drwxr-xr-x 3 root root 3 Jul 17 14:36 .
drwxr-xr-x 17 root root 23 Jul 17 16:27 ..
drwxrwsr-x+ 4 nobody www-data 4096 Jul 17 16:04 ZoneStorage

root@Zoneminder:/# ls -la /mnt/ZoneStorage
total 25
drwxrwsr-x+ 4 nobody www-data 4096 Jul 17 16:04 .
drwxr-xr-x 3 root root 3 Jul 17 14:36 ..
drwxr-sr-x+ 3 www-data www-data 4096 Jul 17 16:04 1
drwxrwsr-x+ 2 nobody www-data 16384 Jul 17 11:06 lost+found
Any advice as to where I can go from here?
User avatar
iconnor
Posts: 3357
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Errors after assigning bind mount to ZM container

Post by iconnor »

Post Reply