Send Motion-user mailing list submissions to
        motion-user@lists.sourceforge.net

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
        motion-user-requ...@lists.sourceforge.net

You can reach the person managing the list at
        motion-user-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. Re: can Motion be run without using sudo (Allan Peda)
   2. Re: can Motion be run without using sudo (Ted Romer)
   3. Re: can Motion be run without using sudo (Jack Christensen)


----------------------------------------------------------------------

Message: 1
Date: Mon, 15 Jul 2019 15:40:58 -0400
From: Allan Peda <bizco...@gmail.com>
To: Motion discussion list <motion-user@lists.sourceforge.net>
Subject: Re: [Motion-user] can Motion be run without using sudo
Message-ID:
        <CAEPoj6y=cz+pvsdy-+7qotnnfckwtkgx8udxltpr1as9a5p...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Be sure SELinux is off before you start adjusting permissions.  I am
running motion with it enabled, but permissions are trickier when it's set
to enforcing.

Here's an article explaining:
https://www.tecmint.com/disable-selinux-temporarily-permanently-in-centos-rhel-fedora/

As to the service, in a modern distro, the systemd subsystem controls why
user "owns" a given service.
https://askubuntu.com/questions/676007/how-do-i-make-my-systemd-service-run-via-specific-user-and-start-on-boot#676022

You'll need to master commands chown, and chmod to get those files
writeable without destroying security.


On Sun, Jul 14, 2019 at 11:48 PM Ted Romer <li227...@gmail.com> wrote:

> I upgraded one of my systems and I am trying to see if I can run Motion
> without sudo. I have a Pi Zero W with Buster Lite and Motion 4.1.1. I have
> been starting Motion on my systems with sudo but I would like to see if I
> can get it to run without sudo. My user account is pi. If I try to run
> Motion as pi it fails out due to lack of permission to write to
> /var/log/motion/motion.log and also cannot create the pid file. If I try to
> get Motion to start as a service I get file permissions errors on
> /var/log/motion/motion.log. When I start motion with sudo, my jpg and video
> files are created with root as the owner. I am having the files saved in a
> directory in pi?s home directory.
>
> I have been searching for information pertaining to how to configure and
> deal with the permissions issues but have not found a solution. Is there a
> way to do it without sudo?
>
> Thanks.
>
> Ted
>
> _______________________________________________
> Motion-user mailing list
> Motion-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/motion-user
> https://motion-project.github.io/
>
> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Mon, 15 Jul 2019 17:51:58 -0500
From: Ted Romer <li227...@gmail.com>
To: Motion discussion list <motion-user@lists.sourceforge.net>
Subject: Re: [Motion-user] can Motion be run without using sudo
Message-ID: <f6fe08ec-059b-4bca-b0fd-343da5516...@gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi all,

Thanks for the suggestions. Unfortunately, none have worked. I tried editing 
/etc/default/motion and setting it to ?yes? (without the quotes) and then I 
issued the command ?sudo systemctl enable motion? (without the quotes) and then 
rebooted. Motion failed to start. This is what I got when I typed sudo 
systemctl status motion

Jul 15 17:33:39 sPiCam2 systemd[1]: Starting LSB: Start Motion detection...
Jul 15 17:33:42 sPiCam2 motion[257]: Starting motion detection daemon: motion.
Jul 15 17:33:43 sPiCam2 systemd[1]: Started LSB: Start Motion detection.
Jul 15 17:33:50 sPiCam2 motion[329]: [17090184:motion] [NTC] [ALL] conf_load: 
Processing thread 0 - config file /etc/motion
Jul 15 17:33:50 sPiCam2 motion[329]: [17090184:motion] [ALR] [ALL] 
conf_cmdparse: Unknown config option "mmalcam_name"
Jul 15 17:33:50 sPiCam2 motion[329]: [17090184:motion] [NTC] [ALL] 
motion_startup: Motion 4.1.1 Started
Jul 15 17:33:50 sPiCam2 motion[329]: [17090184:motion] [ERR] [ALL] myfopen: 
Error opening file /var/log/motion/motion.log w
Jul 15 17:33:50 sPiCam2 motion[329]: [17090184:motion] [EMG] [ALL] 
motion_startup: Exit motion, cannot create log file /var

Every time I try to get it to run as a service I get the file permissions error 
on /var/log/motion/motion.log

It runs okay when I use "sudo motion -c /.motion/motion.conf"    or   " sudo 
motion -c /etc/motion/motion.conf?   (Ihave the motion.conf file in both 
locations

Ted



> On Jul 15, 2019, at 2:40 PM, Allan Peda <bizco...@gmail.com> wrote:
> 
> Be sure SELinux is off before you start adjusting permissions.  I am running 
> motion with it enabled, but permissions are trickier when it's set to 
> enforcing.
> 
> Here's an article explaining:
> https://www.tecmint.com/disable-selinux-temporarily-permanently-in-centos-rhel-fedora/
>  
> <https://www.tecmint.com/disable-selinux-temporarily-permanently-in-centos-rhel-fedora/>
> 
> As to the service, in a modern distro, the systemd subsystem controls why 
> user "owns" a given service.
> https://askubuntu.com/questions/676007/how-do-i-make-my-systemd-service-run-via-specific-user-and-start-on-boot#676022
>  
> <https://askubuntu.com/questions/676007/how-do-i-make-my-systemd-service-run-via-specific-user-and-start-on-boot#676022>
> 
> You'll need to master commands chown, and chmod to get those files writeable 
> without destroying security.
> 
> 
> On Sun, Jul 14, 2019 at 11:48 PM Ted Romer <li227...@gmail.com 
> <mailto:li227...@gmail.com>> wrote:
> I upgraded one of my systems and I am trying to see if I can run Motion 
> without sudo. I have a Pi Zero W with Buster Lite and Motion 4.1.1. I have 
> been starting Motion on my systems with sudo but I would like to see if I can 
> get it to run without sudo. My user account is pi. If I try to run Motion as 
> pi it fails out due to lack of permission to write to 
> /var/log/motion/motion.log and also cannot create the pid file. If I try to 
> get Motion to start as a service I get file permissions errors on 
> /var/log/motion/motion.log. When I start motion with sudo, my jpg and video 
> files are created with root as the owner. I am having the files saved in a 
> directory in pi?s home directory.
> 
> I have been searching for information pertaining to how to configure and deal 
> with the permissions issues but have not found a solution. Is there a way to 
> do it without sudo?
> 
> Thanks.
> 
> Ted
> 
> _______________________________________________
> Motion-user mailing list
> Motion-user@lists.sourceforge.net <mailto:Motion-user@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/motion-user 
> <https://lists.sourceforge.net/lists/listinfo/motion-user>
> https://motion-project.github.io/ <https://motion-project.github.io/>
> 
> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user 
> <https://lists.sourceforge.net/lists/options/motion-user>_______________________________________________
> Motion-user mailing list
> Motion-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/motion-user
> https://motion-project.github.io/
> 
> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 3
Date: Mon, 15 Jul 2019 19:23:14 -0400
From: Jack Christensen <christensen.jac...@gmail.com>
To: motion-user@lists.sourceforge.net
Subject: Re: [Motion-user] can Motion be run without using sudo
Message-ID: <19a572c7-3cc3-0cd2-5dae-56d888769...@gmail.com>
Content-Type: text/plain; charset="utf-8"

I've been running Motion on several Pi Zero W machines without sudo. I
like to create my own user (jack) instead of using pi but I think pi
should work the same.

The config file is /home/jack/.motion/motion.conf

Log and pid files are in my home directory. In the config file I have:

daemon on
setup_mode off
pid_file /home/jack/motion.pid
log_file /home/jack/motion.log

I start motion just with a simple "motion" command.

Works very well.


On 7/15/19 6:51 PM, Ted Romer wrote:
> Hi all,
>
> Thanks for the suggestions. Unfortunately, none have worked. I tried
> editing /etc/default/motion and setting it to ?yes? (without the
> quotes) and then I issued the command ?sudo systemctl enable motion?
> (without the quotes) and then rebooted. Motion failed to start. This
> is what I got when I typed sudo systemctl status motion
>
> Jul 15 17:33:39 sPiCam2 systemd[1]: Starting LSB: Start Motion
> detection...
> Jul 15 17:33:42 sPiCam2 motion[257]: Starting motion detection daemon:
> motion.
> Jul 15 17:33:43 sPiCam2 systemd[1]: Started LSB: Start Motion detection.
> Jul 15 17:33:50 sPiCam2 motion[329]: [17090184:motion] [NTC] [ALL]
> conf_load: Processing thread 0 - config file /etc/motion
> Jul 15 17:33:50 sPiCam2 motion[329]: [17090184:motion] [ALR] [ALL]
> conf_cmdparse: Unknown config option "mmalcam_name"
> Jul 15 17:33:50 sPiCam2 motion[329]: [17090184:motion] [NTC] [ALL]
> motion_startup: Motion 4.1.1 Started
> Jul 15 17:33:50 sPiCam2 motion[329]: [17090184:motion] [ERR] [ALL]
> myfopen: Error opening file /var/log/motion/motion.log w
> Jul 15 17:33:50 sPiCam2 motion[329]: [17090184:motion] [EMG] [ALL]
> motion_startup: Exit motion, cannot create log file /var
>
> Every time I try to get it to run as a service I get the file
> permissions error on /var/log/motion/motion.log
>
> It runs okay when I use "sudo motion -c /.motion/motion.conf" ? ?or ?
> " sudo motion -c /etc/motion/motion.conf? ? (Ihave the motion.conf
> file in both locations
>
> Ted
>
>
>
>> On Jul 15, 2019, at 2:40 PM, Allan Peda <bizco...@gmail.com
>> <mailto:bizco...@gmail.com>> wrote:
>>
>> Be sure SELinux is off before you start adjusting permissions.? I am
>> running motion with it enabled, but permissions are trickier when
>> it's set to enforcing.
>>
>> Here's an article explaining:
>> https://www.tecmint.com/disable-selinux-temporarily-permanently-in-centos-rhel-fedora/
>>
>> As to the service, in a modern distro, the systemd subsystem controls
>> why user "owns" a given service.
>> https://askubuntu.com/questions/676007/how-do-i-make-my-systemd-service-run-via-specific-user-and-start-on-boot#676022
>>
>> You'll need to master commands chown, and chmod to get those files
>> writeable without destroying security.
>>
>>
>> On Sun, Jul 14, 2019 at 11:48 PM Ted Romer <li227...@gmail.com
>> <mailto:li227...@gmail.com>> wrote:
>>
>>     I upgraded one of my systems and I am trying to see if I can run
>>     Motion without sudo. I have a Pi Zero W with Buster Lite and
>>     Motion 4.1.1. I have been starting Motion on my systems with sudo
>>     but I would like to see if I can get it to run without sudo. My
>>     user account is pi. If I try to run Motion as pi it fails out due
>>     to lack of permission to write to /var/log/motion/motion.log and
>>     also cannot create the pid file. If I try to get Motion to start
>>     as a service I get file permissions errors on
>>     /var/log/motion/motion.log. When I start motion with sudo, my jpg
>>     and video files are created with root as the owner. I am having
>>     the files saved in a directory in pi?s home directory.
>>
>>     I have been searching for information pertaining to how to
>>     configure and deal with the permissions issues but have not found
>>     a solution. Is there a way to do it without sudo?
>>
>>     Thanks.
>>
>>     Ted
>>
>>     _______________________________________________
>>     Motion-user mailing list
>>     Motion-user@lists.sourceforge.net
>>     <mailto:Motion-user@lists.sourceforge.net>
>>     https://lists.sourceforge.net/lists/listinfo/motion-user
>>     https://motion-project.github.io/
>>
>>     Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user
>>
>> _______________________________________________
>> Motion-user mailing list
>> Motion-user@lists.sourceforge.net
>> <mailto:Motion-user@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/motion-user
>> https://motion-project.github.io/
>>
>> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user
>
>
>
> _______________________________________________
> Motion-user mailing list
> Motion-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/motion-user
> https://motion-project.github.io/
>
> Unsubscribe: https://lists.sourceforge.net/lists/options/motion-user
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Motion-user mailing list
Motion-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/motion-user


------------------------------

End of Motion-user Digest, Vol 157, Issue 11
********************************************

Reply via email to