Bug#934173: dh-runit: also 'check' file should be executable

2019-08-09 Thread Dmitry Bogatov


control: tags -1 +confirmed +pending

[2019-08-07 20:10] Lorenzo Puliti 
> Package: dh-runit
> Version: 2.8.13.2
> Severity: normal
>
> Hi, 
>
> 'run' file and 'finish' file in the service directory
> are automatically made executable by dh-runit, but not 
> the 'check' file.
>
> Also, I've not tested but I guess that files under the 'control'
> directory may have the same problem.
> Althought they are rarely used they should be executable too
>
> for the record, those files are
> /etc/sv/*/control/c
> /etc/sv/*/control/d
> /etc/sv/*/control/t
> /etc/sv/*/control/u
> /etc/sv/*/control/x

Thank you for report. I prepared patch and regression test and pushed it
into master.

Unfortunately, I can't upload dh-runit into unstable right now, since
its build-dependency `libghc-shake-dev` undergoes transition right now.

From 981e64243e8d12939ae623e344e7fbb37a5367e1 Mon Sep 17 00:00:00 2001
From: Dmitry Bogatov 
Date: Thu, 8 Aug 2019 21:51:26 +
Subject: [PATCH] Ensure that all supported scripts in svdir are executable

Closes: #934173
---
 dh_runit | 15 ++-
 t/checks/934173/check| 11 +++
 t/checks/934173/debian/dh-runit-test.runit   |  1 +
 t/checks/934173/debian/test.rundir/check |  0
 t/checks/934173/debian/test.rundir/control/u |  0
 t/checks/934173/debian/test.rundir/finish|  0
 t/checks/934173/debian/test.rundir/run   |  0
 7 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 t/checks/934173/check
 create mode 100644 t/checks/934173/debian/dh-runit-test.runit
 create mode 100644 t/checks/934173/debian/test.rundir/check
 create mode 100644 t/checks/934173/debian/test.rundir/control/u
 create mode 100644 t/checks/934173/debian/test.rundir/finish
 create mode 100644 t/checks/934173/debian/test.rundir/run

diff --git a/dh_runit b/dh_runit
index 927..9825a4d 100755
--- a/dh_runit
+++ b/dh_runit
@@ -59,7 +59,20 @@ sub parse_options($opts) {
 }
 
 sub ensure_executable($directory) {
-for my $f ('run', 'finish', 'log/run', 'log/finish') {
+my @scripts = (
+'run',
+'finish',
+'check',
+'log/run',
+'log/finish',
+'control/c',
+'control/d',
+'control/t',
+'control/u',
+'control/x',
+);
+
+for my $f (@scripts) {
 my $file = "$directory/$f";
 doit('chmod', '+x', $file) if (-e $file);
 }
diff --git a/t/checks/934173/check b/t/checks/934173/check
new file mode 100644
index 000..38a3bf8
--- /dev/null
+++ b/t/checks/934173/check
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Test::More tests => 3;
+use File::stat;
+
+my $svdir = 'debian/dh-runit-test/etc/sv/test';
+ok(-x "${svdir}/run", "{svdir}/run correctly set executable");
+ok(-x "${svdir}/check", "{svdir}/check correctly set executable");
+ok(-x "${svdir}/control/u", "{svdir}/control/u correctly set executable");
+
diff --git a/t/checks/934173/debian/dh-runit-test.runit 
b/t/checks/934173/debian/dh-runit-test.runit
new file mode 100644
index 000..16e0dcc
--- /dev/null
+++ b/t/checks/934173/debian/dh-runit-test.runit
@@ -0,0 +1 @@
+debian/test.rundir name=test,noreplace,logscript
\ No newline at end of file
diff --git a/t/checks/934173/debian/test.rundir/check 
b/t/checks/934173/debian/test.rundir/check
new file mode 100644
index 000..e69de29
diff --git a/t/checks/934173/debian/test.rundir/control/u 
b/t/checks/934173/debian/test.rundir/control/u
new file mode 100644
index 000..e69de29
diff --git a/t/checks/934173/debian/test.rundir/finish 
b/t/checks/934173/debian/test.rundir/finish
new file mode 100644
index 000..e69de29
diff --git a/t/checks/934173/debian/test.rundir/run 
b/t/checks/934173/debian/test.rundir/run
new file mode 100644
index 000..e69de29
-- 
Note, that I send and fetch email in batch, once in a few days.
Please, mention in body of your reply when you add or remove recepients.



Bug#934173: dh-runit: also 'check' file should be executable

2019-08-07 Thread Lorenzo Puliti
Package: dh-runit
Version: 2.8.13.2
Severity: normal

Hi, 

'run' file and 'finish' file in the service directory
are automatically made executable by dh-runit, but not 
the 'check' file.

Also, I've not tested but I guess that files under the 'control' 
directory may have the same problem.
Althought they are rarely used they should be executable too

for the record, those files are
/etc/sv/*/control/c
/etc/sv/*/control/d
/etc/sv/*/control/t
/etc/sv/*/control/u
/etc/sv/*/control/x
 
Thanks,
Lorenzo


-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-3-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: runit (via /run/runit.stopit)

Versions of packages dh-runit depends on:
ii  debhelper12.2.3
ii  libfile-copy-recursive-perl  0.44-1
ii  libfile-slurp-perl   .27-1
ii  libtext-hogan-perl   2.01-1

dh-runit recommends no packages.

dh-runit suggests no packages.

-- no debconf information