Motion - Support Question 2005x 01x 06x 201636

Run motion at startup with a given user

Question

I want to run motion as apache, to be able to use webdav for collecting data from the storage directory. The only way I know, is before running motion to do "su - apache". I know there is something called motionwatchdog, but I think it uses the root user.

Environment

Motion version: 3.1.17
Libraries: curl, xmlrpc, mysql
Server OS: Debian - Sarge

-- GabrielT - 06 Jan 2005

Answer

Use the SUID feature.

As root change directory to where the motion binary is located.

Change owner to apache. This must be done before the chmod that follows.

chown apache motion

Set the SUID bit.

chmod u+s motion

When you start Motion it now runs as user apache. Note that now you must ensure that the motion.conf is readable by apache. The video device must also be readable by apache.

-- KennethLavrsen - 10 Jan 2005
Topic revision: r3 - 18 Jan 2005, KennethLavrsen
Copyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.