Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#50168 - [motion] please switch from forking to simple

Attached to Project: Community Packages
Opened by Radek Podgorny (rpodgorny) - Wednesday, 27 July 2016, 16:10 GMT
Last edited by Sergej Pupykin (sergej) - Thursday, 04 August 2016, 14:49 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

please change the default setting in /etc/motion/motion.conf from "daemon on" to "daemon off" as it should be by default (noted in the config). also, remove the pid file definition (which, also, is undefined by default).

as a second step, change the Type=forking to Type=simple (or omit it completely) and delete the PIDFile= directive in the service file.

this brings us closer to upstream settings and also makes it easier (and more resilient) for systemd to supervise the process.

thank you,
R.
This task depends upon

Closed by  Sergej Pupykin (sergej)
Thursday, 04 August 2016, 14:49 GMT
Reason for closing:  Won't implement
Additional comments about closing:  motion uses upstream config installed by "make install"
Comment by Doug Newgard (Scimmia) - Wednesday, 27 July 2016, 16:27 GMT
You might want to take a look at this: http://www.lavrsen.dk/svn/motion/trunk/motion-dist.conf.in

The file is what upstream installs as an example.
Comment by Radek Podgorny (rpodgorny) - Wednesday, 27 July 2016, 16:57 GMT
hmmm, i don't understand the "default" comments, then.

anyway, i still think it would be better not to depend on pid file and stuff since we now have systemd with process supervision capabilities.
Comment by Dave Reisner (falconindy) - Wednesday, 27 July 2016, 17:28 GMT
But systemd has no problems supervising processes which fork...

What is actually gained by doing this? I can point out one thing that's lost -- anything which wants to order itself on motion being available will not be able to do after changing from Type=forking to Type=simple.
Comment by Radek Podgorny (rpodgorny) - Wednesday, 27 July 2016, 17:49 GMT
it would bring simplicity. at least in my opinion.

btw, try this:
pacman -Syu motion
systemctl start motion

...you get:

Jul 27 19:46:17 milan motion[6666]: [0] Motion 3.2.12 Started
Jul 27 19:46:17 milan systemd[1]: motion.service: PID file /run/motion/motion.pid not readable (yet?) after start: No such file or directory
Jul 27 19:46:17 milan motion[6668]: [0] Exit motion, cannot create process id file (pid file) /var/run/motion/motion.pid: No such file or directory
Jul 27 19:46:17 milan systemd[1]: motion.service: Daemon never wrote its PID file. Failing.
Jul 27 19:46:17 milan systemd[1]: Failed to start Motion daemon.

:-(
Comment by Dave Reisner (falconindy) - Wednesday, 27 July 2016, 17:54 GMT
That's simply a packaging failure which can be resolved by adding a 'systemd-tmpfiles' call to an install scriptlet or setting RuntimeDirectory=motion in the service.
Comment by Radek Podgorny (rpodgorny) - Wednesday, 27 July 2016, 18:08 GMT
true.

but isn't removing stuff (simplification) better than adding (complication)?
Comment by Dave Reisner (falconindy) - Wednesday, 27 July 2016, 18:14 GMT
No, my world isn't so black and white. As explained, there are consequences of your "simplicity".
Comment by Radek Podgorny (rpodgorny) - Wednesday, 27 July 2016, 18:25 GMT
i still don't get what you meant by "anything which wants to order itself on motion being available will not be able to do"... ...isn't that something "systemctl is-active" is supposed to do?

anyway, you're the boss here. ;-) ...so, please at least fix the package. thanks. ;-)
Comment by Dave Reisner (falconindy) - Wednesday, 27 July 2016, 18:32 GMT
'systemctl is-active' bears little relevance here.

If you have a service which states After=motion.service, you really do want to know that motion is running and healthy before starting this other service. In order to do that, you need systemd to know when the service has successfully started. For Type=forking units, this is when the main control process has exited (leaving the child daemon behind). For Type=dbus, it's when the service has claimed the provided BusName on the bus. For Type=simple services, there is *no readiness mechanism of any kind*. systemd just assumes the process is healthy as soon as it execs the child. This type is only suitable for cases when you *know* apriori that no reverse dependencies will exist, or socket activated services.

Loading...