[mythtv-users] Mythzmserver DB problems. Was: doesn't start:...
A. F. Cano
afc54 at comcast.net
Tue Apr 27 13:19:27 UTC 2021
On Tue, Apr 27, 2021 at 12:39:39PM +0200, Hika van den Hoven wrote:
> Hoi A.,
>
> ...
This ls was done after I added g+rw to zm.mmap.2
> > $ ls -l /dev/shm
> > total 72024
> > -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
> > -rw-rw---- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2
>
> You should check if that user has access to the folder ánd to the path
> leading there (r+x). The easiest way to check is to try reading the
> file as that user. If you need write permission, try to echo to a file
Yes, but since the program reading and writing this file is mythzserver
and it's run as root, that shouldn't be an issue, right?
Zoneminder creates the shared memory file like this:
-rw------- 1 www-data www-data 73733672 Apr 27 09:11 zm.mmap.2
With rw permissions for root.
> in that directory as that user.
> echo test > /dev/shm/test
> echo test > /dev/shm/test
WIth soneminder not running, so the zm file is not there.
afc$ echo test > /dev/shm/test
afc$ ls -l /dev/shm
total 20
-rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
-rw-r--r-- 1 afc afc 5 Apr 27 08:40 test
afc$ echo test >> /dev/shm/test
afc$ ls -l /dev/shm
total 20
-rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
-rw-r--r-- 1 afc afc 10 Apr 27 08:41 test
afc$ cat /dev/shm/test
test
test
afc$ chown www-data:www-data /dev/shm/test
chown: changing ownership of '/dev/shm/test': Operation not permitted
afc$ sudo chown www-data:www-data /dev/shm/test
[sudo] password for afc:
# so once the ownership is changed, I can no longer write to it,
afc$ cat /dev/shm/test
test
test
afc$ echo test >> /dev/shm/test
bash: /dev/shm/test: Permission denied
afc$ sudo echo test >> /dev/shm/test
bash: /dev/shm/test: Permission denied
afc$ sudo www-data echo test >> /dev/shm/test
bash: /dev/shm/test: Permission denied
# But as root (like mythzmserver runs), it it still possible.
hp-i3:1:/home/afc> su
Password:
# echo test >> /dev/shm/test
# cat /dev/shm/test
test
test
test
So, running as root (su) I can write to the test file. This should be
how mythzmserver manages it since it's run as root. Or am I missing
something?
> Tot mails,
> Hika mailto:hikavdh at gmail.com
Thanks.
Augustine
More information about the mythtv-users
mailing list