Control: severity -1 important
Control: tags -1 patch
--

Marking this bug as important as the package is mostly unusable by a 
non-technical user.
The motion.service can only start if the user manually creates /var/log/motion 
folder.

Patch attached to fix this. The suggested change was already part of the
motion init script but was dropped when updating it to systemd service.
The old code can be seen at: 
https://sources.debian.org/src/motion/4.1.1-1.1/debian/motion.init/#L60

-- 
Regards
Sudip
diff -Nru motion-4.6.0/debian/changelog motion-4.6.0/debian/changelog
--- motion-4.6.0/debian/changelog       2023-11-12 19:17:59.000000000 +0000
+++ motion-4.6.0/debian/changelog       2024-03-05 22:24:01.000000000 +0000
@@ -1,3 +1,10 @@
+motion (4.6.0-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Create log folder if it does not exist. (Closes: #849712)
+
+ -- Sudip Mukherjee <sudipm.mukher...@gmail.com>  Tue, 05 Mar 2024 22:24:01 
+0000
+
 motion (4.6.0-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru motion-4.6.0/debian/motion.postinst 
motion-4.6.0/debian/motion.postinst
--- motion-4.6.0/debian/motion.postinst 2023-02-03 12:28:41.000000000 +0000
+++ motion-4.6.0/debian/motion.postinst 2024-03-05 22:24:01.000000000 +0000
@@ -24,8 +24,16 @@
     fi
 }
 
+add_log_if_missing() {
+    if ! [ -d /var/log/motion ]; then
+         mkdir -m 02750 /var/log/motion
+         chown motion:adm /var/log/motion
+    fi
+}
+
 add_group_if_missing
 add_user_if_missing
+add_log_if_missing
 
 db_stop
 

Reply via email to