Package: release.debian.org
Severity: normal
Tags: jessie
User: release.debian@packages.debian.org
Usertags: pu
Hi!
I would like to important issues affecting coquelicot in jessie:
#809351: properly run coquelicot under the 'coquelicot' user and not
as root. It was always intended that way, that's why the cron is running
under the coquelicot user already. The issue has been fixed a while ago
for stretch (in 0.9.4-1, uploaded September 2015). This backports the
changes from the unstable branch which switched to using
init-d-script(5).
#808018: silence deprecation warnings coming from cron. While the
warnings actually come from ruby-fast-gettext, they make the garbage
collection cron send an email on every run.
debdiff is attached.
Better late than never the old issues, and thanks for your review!
--
Lunar.''`.
lu...@debian.org: :Ⓐ : # apt-get install anarchism
`. `'`
`-
diff -Nru coquelicot-0.9.2/debian/changelog coquelicot-0.9.2/debian/changelog
--- coquelicot-0.9.2/debian/changelog 2014-09-01 18:08:55.0 +0200
+++ coquelicot-0.9.2/debian/changelog 2016-12-16 18:08:03.0 +0100
@@ -1,3 +1,14 @@
+coquelicot (0.9.2-4+deb8u1) stable; urgency=medium
+
+ * Backport init.d fixes from stretch to properly run the daemon as
+coquelicot:coquelicot. Thanks Edouard GAULUE for noticing this
+needed to be fixed in jessie. (Closes: #809351)
+ * Suppress deprecation warnings when running the daemon and garbage
+collection in cron. Thanks Matteo Calorio for the report.
+(Closes: #808018)
+
+ -- Jérémy Bobbio Fri, 16 Dec 2016 18:08:03 +0100
+
coquelicot (0.9.2-4) unstable; urgency=medium
* Fix Build-Depends for activesupport. (Closes: #759921)
diff -Nru coquelicot-0.9.2/debian/control coquelicot-0.9.2/debian/control
--- coquelicot-0.9.2/debian/control 2014-09-01 18:08:55.0 +0200
+++ coquelicot-0.9.2/debian/control 2016-12-16 17:46:12.0 +0100
@@ -54,6 +54,7 @@
ruby-sinatra-contrib,
ruby-upr,
ruby | ruby-interpreter,
+ sysvinit-utils (>= 2.88dsf-50),
${misc:Depends},
${shlibs:Depends}
Recommends: apache2 | nginx | pound
diff -Nru coquelicot-0.9.2/debian/coquelicot.cron.d coquelicot-0.9.2/debian/coquelicot.cron.d
--- coquelicot-0.9.2/debian/coquelicot.cron.d 2014-09-01 18:08:55.0 +0200
+++ coquelicot-0.9.2/debian/coquelicot.cron.d 2016-12-16 18:07:45.0 +0100
@@ -1,4 +1,4 @@
# crontab fragment for coquelicot
# Run the garbage collection procedure every 15 minutes
-11,26,41,56 * * * * coquelicot [ -x /usr/bin/coquelicot ] && [ -f /etc/coquelicot/settings.yml ] && /usr/bin/coquelicot gc
+11,26,41,56 * * * * coquelicot [ -x /usr/bin/coquelicot ] && [ -f /etc/coquelicot/settings.yml ] && RUBYOPT="-W0" /usr/bin/coquelicot gc
diff -Nru coquelicot-0.9.2/debian/coquelicot.init.d coquelicot-0.9.2/debian/coquelicot.init.d
--- coquelicot-0.9.2/debian/coquelicot.init.d 2014-09-01 18:08:55.0 +0200
+++ coquelicot-0.9.2/debian/coquelicot.init.d 2016-12-16 18:07:45.0 +0100
@@ -1,4 +1,8 @@
#!/bin/sh
+# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
+if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
+set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
+fi
### BEGIN INIT INFO
# Provides: coquelicot
# Required-Start:$remote_fs
@@ -10,91 +14,38 @@
#with a focus on protecting users' privacy.
### END INIT INFO
-# Do NOT "set -e"
+# Author: Jérémy Bobbio
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC='Coquelicot "one-click" file sharing web application'
-NAME=coquelicot
DAEMON=/usr/bin/coquelicot
DAEMON_ARGS="start"
-PIDFILE=/var/run/$NAME.pid
-SCRIPTNAME=/etc/init.d/$NAME
+PIDFILE=/var/run/coquelicot/coquelicot.pid
-. /lib/lsb/init-functions
+# can be overriden in /etc/default/coquelicot
+USER=coquelicot
+GROUP=coquelicot
-do_start()
-{
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
- || return 1
- LC_ALL=C.UTF-8 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
- $DAEMON_ARGS \
- || return 2
+
+do_start_prepare() {
+ START_ARGS="--chuid $USER:$GROUP"
+ /usr/bin/install -m 02750 -o "$USER" -g "$USER" -d "$(dirname "$PIDFILE")"
+
+ # suppress deprecation warnings
+ export RUBYOPT="-W0"
}
-do_stop()
-{
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+# We can't use init-d-script(5) do_stop_cmd() because it matches on the
+# executable path and Coquelicot is written in Ruby. So this is almost
+# the same function but without `--exec` when calling `start-stop-daemon`.
+# We still send QUIT before sending TERM to be hope that worker will
+# terminate gracefully.
+do_stop_cmd() {
+ start-stop-daemon --stop --quiet