Bug#972685: needrestart: Please add support for runit

2020-10-30 Thread Lorenzo
Thank You :)

On 10/29/20 7:24 PM, Thomas Liske wrote:
> Hi Lorenzo,
>
>
> thanks for the updated patch. I've applied it upstream and will be
> part of needrestart 3.6+.
>
>
> Regards,
> Thomas
>
>
>
> On 23.10.20 12:12, Lorenzo Puliti wrote:
>> Package: needrestart
>> Version: 3.5-1
>> Followup-For: Bug #972685
>>
>>
>> On 10/22/20 8:16 PM, Thomas Liske wrote:
>>> Hi,
>>>
>>> thanks for the patch. Would it possible that you provide a updated
>>> patch
>>>   compatible with upstream's git HEAD?
>>>
>>
>>
>> Hi,
>>
>> You should be able to git am the patch attached to this message.
>> Note that i've used 'service' instead of invoke-run, to be consistent
>> with upstream code, so this will need further work on Debian side,
>> updating and refreshing the quilt '01-use-invoke-rc.d.diff' patch.
>>
>> Regards,
>> Lorenzo
>>


Bug#972685: needrestart: Please add support for runit

2020-10-29 Thread Thomas Liske

Hi Lorenzo,


thanks for the updated patch. I've applied it upstream and will be part 
of needrestart 3.6+.



Regards,
Thomas



On 23.10.20 12:12, Lorenzo Puliti wrote:

Package: needrestart
Version: 3.5-1
Followup-For: Bug #972685


On 10/22/20 8:16 PM, Thomas Liske wrote:

Hi,

thanks for the patch. Would it possible that you provide a updated patch
  compatible with upstream's git HEAD?




Hi,

You should be able to git am the patch attached to this message.
Note that i've used 'service' instead of invoke-run, to be consistent
with upstream code, so this will need further work on Debian side,
updating and refreshing the quilt '01-use-invoke-rc.d.diff' patch.

Regards,
Lorenzo





Bug#972685: needrestart: Please add support for runit

2020-10-23 Thread Lorenzo Puliti
Package: needrestart
Version: 3.5-1
Followup-For: Bug #972685


On 10/22/20 8:16 PM, Thomas Liske wrote:
> Hi,
> 
> thanks for the patch. Would it possible that you provide a updated patch 
>  compatible with upstream's git HEAD?
>


Hi,

You should be able to git am the patch attached to this message.
Note that i've used 'service' instead of invoke-run, to be consistent
with upstream code, so this will need further work on Debian side,
updating and refreshing the quilt '01-use-invoke-rc.d.diff' patch.

Regards,
Lorenzo
>From 6a7ae3df50ab24c833db3c1ba2d771688347097e Mon Sep 17 00:00:00 2001
From: Lorenzo Puliti 
Date: Fri, 23 Oct 2020 10:46:55 +0200
Subject: [PATCH] Add support for runit

When runit is used as init system, a native runscript exists
and is enabled, use 'sv' instead of 'service'.
If no native runscript exists (or is disabled) we fallback on 'service'
---
 needrestart | 9 +
 1 file changed, 9 insertions(+)

diff --git a/needrestart b/needrestart
index d5c94fd..7d70633 100755
--- a/needrestart
+++ b/needrestart
@@ -46,6 +46,7 @@ $Getopt::Std::STANDARD_HELP_VERSION++;
 
 my $LOGPREF = '[main]';
 my $is_systemd = -d q(/run/systemd/system);
+my $is_runit = -e q(/run/runit.stopit);
 my $is_tty = (-t *STDERR || -t *STDOUT || -t *STDIN);
 my $is_vm;
 my $is_container;
@@ -386,6 +387,14 @@ sub restart_cmd($) {
(qw(systemctl restart), qq($rc.service));
}
}
+   elsif($is_runit && -d qq(/etc/sv/$rc)) {
+   if(-e qq(/etc/service/$rc)) {
+   (qw(sv restart), $rc);
+   }
+   else {
+   (q(service), $rc, q(restart));
+   }
+   }
else {
(q(service), $rc, q(restart));
}
-- 
2.28.0



Bug#972685: needrestart: Please add support for runit

2020-10-22 Thread Thomas Liske

Hi,

thanks for the patch. Would it possible that you provide a updated patch 
 compatible with upstream's git HEAD?



Regards,
Thomas
(Upstream)


On 22.10.20 16:55, Lorenzo Puliti wrote:

Package: needrestart
Version: 3.5-1
Severity: normal
Tags: patch

Dear maintainer,

Please consider the attached patch that adds support for runit to needrestart.
Runit is a very lightweight init scheme with service supervision capability;
for more details see http://smarden.org/runit/

Regards,
Lorenzo Puliti



-- Package-specific info:
needrestart output:
Your outdated processes:
kactivitymanage[23935], kdeconnectd[22453], kded5[6680], kdeinit5[6696], 
kglobalaccel5[23942], klauncher[6697], konqueror[6620], kuiserver[22496], 
lxqt-notificati[5553], lxqt-panel[5557], lxqt-policykit-[5558], 
lxqt-powermanag[8009], lxqt-runner[5559], lxqt-session[5460], openbox[5530], 
qjackctl[8006], qterminal[8833, 5222], QtWebEngineProc[9293, 6647], 
superkaramba[8014]



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

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

Versions of packages needrestart depends on:
ii  binutils   2.35.1-2
ii  dpkg   1.20.5
ii  gettext-base   0.19.8.1-10
ii  libintl-perl   1.26-2
ii  libmodule-find-perl0.15-1
ii  libmodule-scandeps-perl1.29-1
ii  libproc-processtable-perl  0.59-2
ii  libsort-naturally-perl 1.03-2
ii  libterm-readkey-perl   2.38-1+b1
ii  perl   5.30.3-4
ii  xz-utils   5.2.4-1+b1

Versions of packages needrestart recommends:
ii  libpam-elogind-compat [libpam-systemd]  1.2

Versions of packages needrestart suggests:
ii  iucode-tool  2.3.1-1
pn  needrestart-session | libnotify-bin  

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/sbin/needrestart (from needrestart package)





Bug#972685: needrestart: Please add support for runit

2020-10-22 Thread Lorenzo Puliti
Package: needrestart
Version: 3.5-1
Severity: normal
Tags: patch

Dear maintainer,

Please consider the attached patch that adds support for runit to needrestart.
Runit is a very lightweight init scheme with service supervision capability;
for more details see http://smarden.org/runit/

Regards,
Lorenzo Puliti



-- Package-specific info:
needrestart output:
Your outdated processes:
kactivitymanage[23935], kdeconnectd[22453], kded5[6680], kdeinit5[6696], 
kglobalaccel5[23942], klauncher[6697], konqueror[6620], kuiserver[22496], 
lxqt-notificati[5553], lxqt-panel[5557], lxqt-policykit-[5558], 
lxqt-powermanag[8009], lxqt-runner[5559], lxqt-session[5460], openbox[5530], 
qjackctl[8006], qterminal[8833, 5222], QtWebEngineProc[9293, 6647], 
superkaramba[8014]



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

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

Versions of packages needrestart depends on:
ii  binutils   2.35.1-2
ii  dpkg   1.20.5
ii  gettext-base   0.19.8.1-10
ii  libintl-perl   1.26-2
ii  libmodule-find-perl0.15-1
ii  libmodule-scandeps-perl1.29-1
ii  libproc-processtable-perl  0.59-2
ii  libsort-naturally-perl 1.03-2
ii  libterm-readkey-perl   2.38-1+b1
ii  perl   5.30.3-4
ii  xz-utils   5.2.4-1+b1

Versions of packages needrestart recommends:
ii  libpam-elogind-compat [libpam-systemd]  1.2

Versions of packages needrestart suggests:
ii  iucode-tool  2.3.1-1
pn  needrestart-session | libnotify-bin  

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/sbin/needrestart (from needrestart package)
Description: Add support for runit init system
 When runit is used as init system, a native runit service exists and is 
enabled,
 use sv instead of invoke-rc.d. If no native service exists (or is disabled) 
fallback
 on invoke-rc.d
Author: Lorenzo Puliti 
Last-Update: 2020-10-22
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/needrestart
+++ b/needrestart
@@ -46,6 +46,7 @@
 
 my $LOGPREF = '[main]';
 my $is_systemd = -d q(/run/systemd/system);
+my $is_runit = -e q(/run/runit.stopit);
 my $is_tty = (-t *STDERR || -t *STDOUT || -t *STDIN);
 my $is_vm;
 my $is_container;
@@ -386,6 +387,14 @@
(qw(systemctl restart), qq($rc.service));
}
}
+   elsif($is_runit && -d qq(/etc/sv/$rc)) {
+   if(-e qq(/etc/service/$rc)) {
+   (qw(sv restart), $rc);
+   }
+   else {
+   (q(invoke-rc.d), $rc, q(restart));
+   }
+   }
else {
(q(invoke-rc.d), $rc, q(restart));
}