Send Motion-user mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."
Today's Topics:
1. Can't set group write permission for directories/files
created by motion (Henk Demper)
2. Re: Can't set group write permission for directories/files
created by motion (Damian)
----------------------------------------------------------------------
Message: 1
Date: Mon, 28 Dec 2020 22:01:56 +0100
From: Henk Demper <[email protected]>
To: [email protected]
Subject: [Motion-user] Can't set group write permission for
directories/files created by motion
Message-ID:
<as8pr10mb437382d821b01d6c55801b0693...@as8pr10mb4373.eurprd10.prod.outlook.com>
Content-Type: text/plain; charset="us-ascii"
Hello,
I am running Motion 4.3.1 on Asus Tinkerboard under Debian 9.13 (Stretch),
installed using downloaded builddeb.sh and the created .deb file. Motion is
running fine for in daemon mode with 4 IP camera's. But there is one thing I
have tried to figure out without success...
The main motion directory has access rights drwxrwxrwx (777), which was
manually set.
Inside that directory motion (via motion.conf file) will create sub-directories
for each camera, which get access right drwxr-xr-x (755).
All created files (Log.txt and all video files like motion .mkv, snapshot .jpg
and time-lapse .mpg) will have access right -rw-r--r-- (644).
So it appears that the default umask value of 022 is applied for these (File:
666, mask 022 -> 644 and directory 777, mask -> 755)
As a normal (non-root, non-motion) user (like 'linaro' on Tinkerboard) I can
browse the created video files mentioned above. But to remove them (for
cleanup, maintenance...), I will need to do that as root, which is
inconvenient. I would like to have the 'write' attributes set for the group
permission for these files & directories, such that I can delete these files as
normal user (given my group access permits that).
As I understand and see, motion in daemon mode will run as user motion. User
motion has primary group motion, which is part of the video group. I understand
that all file access is done via either C open() or fopen(), which are
permission-unaware. Hence the current umask setting will be used. Following
https://www.computernetworkingnotes.com/rhce-study-guide/how-to-change-default-umask-permission-in-linux.html
<https://www.computernetworkingnotes.com/rhce-study-guide/how-to-change-default-umask-permission-in-linux.html>
I have set 'umask 002' in /etc/bash.bashrc, /etc/profile,
/etc/profile.d/umask.sh and /var/lib/motion/.bashrc (motion's home directory),
but in all cases when I restart the Tinkerboard, motion running as daemon will
create new files with permission -rw-r--r-- (644), not -rw-rw-r-- (664) as I
hoped, so the 'umask 002' setting seems ignored.
What am I doing wrong, how can I solve this ? Perhaps this is not 100% motion
related, but more general linux, but it seemed appropriate to post here, as I
assume I might not be the only one in this situation...
Many thanks in advance,
Henk Demper
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 2
Date: Tue, 29 Dec 2020 07:39:32 +0100
From: Damian <[email protected]>
To: [email protected]
Subject: Re: [Motion-user] Can't set group write permission for
directories/files created by motion
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
Have a look at debian/motion.service inside [1], add UMask=0002 to the
[Service] section. Stop your running motion, save the
supplemented motion.service as [2], issue systemctl daemon-reload, and start
motion again.
> What am I doing wrong, how can I solve this ? Perhaps this is not 100% motion
> related, but more general linux, but it seemed
> appropriate to post here, as I assume I might not be the only one in this
> situation.
[1] http://deb.debian.org/debian/pool/main/m/motion/motion_4.3.2-1.debian.tar.xz
[2] /etc/systemd/system/motion.service
------------------------------
------------------------------
Subject: Digest Footer
_______________________________________________
Motion-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/motion-user
------------------------------
End of Motion-user Digest, Vol 174, Issue 10
********************************************