Cannot acces storage

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
Neon_Light
Posts: 2
Joined: Wed Sep 22, 2021 9:27 am

Cannot acces storage

Post by Neon_Light »

Hello all,
Think I did something stupid, thing is I spend all day trying to find whats wrong. But I can not figure out what it is.

For some reason I cant store images on a local flash card.

Hardware setup and OS
Hardware: I use a SBC (single board computer) Odroid N2+ (something like a Raspberry Pi)
OS: Ubuntu 20.04.3 LTS
Zoneminder is version v1.32

I get the following errors and warnings shown in the log:

line 160:
Storage::disk_usage_percent: path /home/odroid/Documents/Link_to_events does not exist /usr/share/zoneminder/www/includes/Storage.php

line 169:
Cannot write to content dirs('/media/odroid/128G_Flash/ZoneMinder/events','/var/cache/zoneminder/images'). Check that these exist and are owned by the web account user /usr/share/zoneminder/www/index.php

line 181:
Path /home/odroid/Documents/Link_to_events does not exist. /usr/share/zoneminder/www/includes/Storage.php

line 198:
Path /home/odroid/Documents/Link_to_events does not exist. /usr/share/zoneminder/www/includes/Storage.php

I did check the target folder (with command ls -l in the console) and it seems the folder is owned by user www-data

drwxrwxr-x 2 www-data www-data 4096 Dec 24 14:21 events
also did check zm.conf

-rwxr----- 1 root www-data 1817 Sep 17 11:09 zm.conf

and for the folder images:
drwxr-xr-x 2 www-data www-data 4096 Feb 25 2020 images

I did also check the zm.conf and it shows:

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


ZoneMinder database user is not www-data but that should be okay ?
In the last attempt I changed the location to a link to the flash disk I first tried to access the directory directly but without any success

I hope you can help me I dont know what to change to make it work
Neon_Light
Posts: 2
Joined: Wed Sep 22, 2021 9:27 am

Re: Cannot acces storage

Post by Neon_Light »

Fixed it. I got some advice from some guys at IRC thank you!!
I had to do the following:

sudo su - www-data -s /bin/bash this way you become user www-data
start at the / and cd towards the end of /media/odroid/128G_Flash/ZoneMinder/events
as user: 'www-data' I could go into the folder /media but I could not enter /media/odroid I got a 'permision denied'
I was told that although the command ls -ld shows sufficient rights for the user www-data to enter the folder /media/odroid/128G_Flash/ZoneMinder/events
the user www-data can not get there because the user can not 'pass trough' /media/odroid so I also had to change the rights of this folder
chmod o+x odroid
this fixed the problem
the guys at irc told me this is fine for non commercial server but a more serious approach would be to use acl's

hope this helps someonne else !!
Post Reply