Bug#848365: jessie-pu: package coquelicot/0.9.2-4+deb8u1

2018-06-13 Thread Adam D. Barratt
On Sat, 2017-01-07 at 17:06 +0100, Julien Cristau wrote:
> On Thu, Jan  5, 2017 at 10:20:19 +0100, Jérémy Bobbio wrote:
> 
> > You are right. I agree it's not a minimal change but the initscript
> > using init-d-script has been in Stretch for more than a year. I
> > thought
> > it would be safer to use a version that has received more testing
> > than
> > to patch the older one. I could still do that if you'd prefer.
> > 
> 
> Yes please.
> 

There's been no follow-up since that point, and we're now only a few
days away from closing updates to jessie before it becomes LTS.

Is this something you're still interested in addressing?

Regards,

Adam



Bug#848365: jessie-pu: package coquelicot/0.9.2-4+deb8u1

2017-01-07 Thread Julien Cristau
On Thu, Jan  5, 2017 at 10:20:19 +0100, Jérémy Bobbio wrote:

> You are right. I agree it's not a minimal change but the initscript
> using init-d-script has been in Stretch for more than a year. I thought
> it would be safer to use a version that has received more testing than
> to patch the older one. I could still do that if you'd prefer.
> 
Yes please.

Cheers,
Julien



Bug#848365: jessie-pu: package coquelicot/0.9.2-4+deb8u1

2017-01-05 Thread Jérémy Bobbio
Adam D. Barratt:
> Control: tags -1 + moreinfo
> 
> On Fri, 2016-12-16 at 18:31 +0100, Jérémy Bobbio wrote:
> > 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.
> 
> + sysvinit-utils (>= 2.88dsf-50),
> 
> What's that for? sysvinit-utils is Essential:yes.
> 
> Hmmm, so the answer appears to be "because that's when init-d-script(5)
> was added". That doesn't really seem like a minimal change for fixing
> the user that the daemon is running as.

You are right. I agree it's not a minimal change but the initscript
using init-d-script has been in Stretch for more than a year. I thought
it would be safer to use a version that has received more testing than
to patch the older one. I could still do that if you'd prefer.

-- 
Lunar.''`. 
lu...@debian.org: :Ⓐ  :  # apt-get install anarchism
`. `'` 
  `-   


signature.asc
Description: Digital signature


Bug#848365: jessie-pu: package coquelicot/0.9.2-4+deb8u1

2017-01-04 Thread Adam D. Barratt
Control: tags -1 + moreinfo

On Fri, 2016-12-16 at 18:31 +0100, Jérémy Bobbio wrote:
> 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.

+ sysvinit-utils (>= 2.88dsf-50),

What's that for? sysvinit-utils is Essential:yes.

Hmmm, so the answer appears to be "because that's when init-d-script(5)
was added". That doesn't really seem like a minimal change for fixing
the user that the daemon is running as.

Regards,

Adam



Processed: Re: Bug#848365: jessie-pu: package coquelicot/0.9.2-4+deb8u1

2017-01-04 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 + moreinfo
Bug #848365 [release.debian.org] jessie-pu: package coquelicot/0.9.2-4+deb8u1
Added tag(s) moreinfo.

-- 
848365: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848365
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#848365: jessie-pu: package coquelicot/0.9.2-4+deb8u1

2016-12-16 Thread Jérémy Bobbio
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