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!
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!
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
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
|
Detailsplease 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"
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"
The file is what upstream installs as an example.
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.
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.
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.
:-(
but isn't removing stuff (simplification) better than adding (complication)?
anyway, you're the boss here. ;-) ...so, please at least fix the package. thanks. ;-)
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.