Motion and systemd

When I run motion from the command line works just fine. E.g. as root user both:

# Run as daemon
motion -b

or

# Run normally
motion -n

works fine but:

service motion start

fails and outputs:


● motion.service - Motion capture                                                                         
   Loaded: loaded (/usr/lib/systemd/system/motion.service; enabled; vendor preset: disabled)
   Active: deactivating (stop-sigterm) since Sun 2019-08-11 03:07:27 MST; 21ms ago
  Process: 557 ExecStart=/usr/bin/motion ${MOTION_OPTIONS} (code=exited, status=0/SUCCESS)
 Main PID: 557 (code=exited, status=0/SUCCESS)
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/motion.service
           └─558 /usr/bin/motion

Does anyone have any idea why this would be the case?

Try

systemctl start motion

If it still fails, then inspect the code snippet (or post) the results of

systemctl status motion

TSU

reproducible on tumbleweed (03.2021) - and 15.2:

motion (4.3.2) runs fine (after correct configuration :wink: ) from command-line with motion -b
but stops with systemd typically standard-stuff:

systemctl start motion

via standard:
/usr/lib/systemd/system/motion.service

Reason:
probably a kind of double-deamon problem?

see:
Force motion to run in non-daemon mode in systemd service by slokhorst · Pull Request #303 · Motion-Project/motion · GitHub

**slokhorst ** commented on 16 Jan 2017

                  |           The systemd service file, with Type=simple, expects motion to run in non-daemon mode, and not fork. If daemon on is set in motion.conf, the service will fail to run. Better to force the right mode from the service file to prevent misconfiguration.|

|—|

removing deamon-mode in motion.conf works for me

When you really want to draw attention to your problem, then start a new thread. Hanging this at the end of an almost 2 years old thread, which was in a time of different openSUSE and other versions, is not very productive I am afraid.