Subject: bug#802: openrc: openrc-run: to many broken options

From: Lorietta <[email-masked]>
Date: Sun, 19 Nov 2023 16:32:19 +1100

Package: openrc
Version: 0.45.2-2
Severity: normal
X-Debbugs-Cc: [email-masked]

Dear Maintainer,

When writing an init script with the openrc-run interpreter, and the
start-stop-daemon supervisor (used by default),
you cannot pass options such as 'output_log' and 'error_log',
because the Debian version of start-stop-daemon is incompatible with the
start-stop-daemon version from Gentoo.
openrc-run tries to pass options to start-stop-daemon that are known in
Gentoo,
but not understood by Debian's start-stop-daemon.

in this case, '--stdout' and '--stderror'. The Gentoo's start-stop-daemon
'--stderror' option has no equivalent in Debian,
the '--stdout' option can be replaced with '-O' or '--output'.
the same problem can be observed when using other options.
here is the complete list:
'output_log' (can be replaced with '--output' in Debian)
'error_log' (has no equivalent in Debian)
'output_logger' (has no equivalent in Debian)
'error_logger' (has no equivalent in Debian)
'capabilities' (has no equivalent in Debian)
For example, service 'myservice' with 'output_log=/var/log/myservice.log':

$ rc-service myservice start

Starting myservice ...

start-stop-daemon: unrecognized option "--stdout"

Try "start-stop-daemon --help" for more information.

Failed to start myservice

ERROR: myservice failed to start

I did not submit this bug to the Debian BTS because Debian has officially
switched to systemd
and I doubt that this bug report will be noticed there.

-- System Information:
Distributor ID: Devuan
Description: Devuan GNU/Linux 5 (daedalus)
Release: 5
Codename: daedalus
Architecture: x86_64

Kernel: Linux 6.1.0-13-amd64 (SMP w/6 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE
not set
Shell: /bin/sh linked to /bin/dash
Init: OpenRC (via /run/openrc), PID 1: openrc-init

Versions of packages openrc depends on:
ii  insserv      1.24.0-1
ii  libaudit1    1:3.0.9-1
ii  libc6        2.36-9+deb12u3
ii  libeinfo1    0.45.2-2
ii  libpam0g     1.5.2-6+deb12u1
ii  librc1       0.45.2-2
ii  libselinux1  3.4-1+b6

openrc recommends no packages.

Versions of packages openrc suggests:
pn  policycoreutils  <none>
ii  sysvinit-core    3.06-4devuan3

-- Configuration Files:
/etc/init.d/agetty [Errno 13] Permission denied: '/etc/init.d/agetty'
/etc/init.d/cgroups [Errno 13] Permission denied: '/etc/init.d/cgroups'
/etc/init.d/rc [Errno 13] Permission denied: '/etc/init.d/rc'
/etc/init.d/rcS [Errno 13] Permission denied: '/etc/init.d/rcS'
/etc/init.d/savecache [Errno 13] Permission denied: '/etc/init.d/savecache'
/etc/rc.conf changed [not included]

-- debconf-show failed

---

From: Mark Hindley <[email-masked]>
Date: Mon, 20 Nov 2023 17:53:19 +0000

Control: tags -1 debian

Lorietta,

On Sun, Nov 19, 2023 at 04:32:19PM +1100, Lorietta wrote:
>    because the Debian version of start-stop-daemon is incompatible with
>    the start-stop-daemon version from Gentoo.

This is by design. Having another start-stop-daemon on Debian with different
behaviour and options would create many problems.

>    I did not submit this bug to the Debian BTS because Debian has
>    officially switched to systemd

It would have been -- I maintain the openrc package in Debian.

The best I can do is offer to document this more clearly. Probably the
README.Debian would be best.

What do you think?

Mark

---

From: Mark Hindley <[email-masked]>
Date: Mon, 20 Nov 2023 20:20:27 +0000

This is an initial paragraph to add to README.Debian. Does it help?

 Note that Debian's packaging excludes openrc's start-stop-daemon to avoid
 changing the default implementation from src:dpkg.  The two implementations
 differ slightly in terms of the options accepted and their spelling. Ensure you
 use options compatible with start-stop-daemon(1) in your scripts.

Can you improve it?

Thanks

Mark

---

From: meow <[email-masked]>
Date: Tue, 21 Nov 2023 16:50:01 +0000

I think it is worth correcting the behavior when using the option 'output_log'. 
it can be done without difficulty by simply editing the file /lib/rc/sh/start-stop-daemon.sh

should change the line number 48 from '${output_log+--stdout} $output_log '
to {output_log+--output} $output_log '.

this will allow to use the 'output_log' option with start-stop-daemon from Debian.

It is not possible to correct the behavior of the other options because they have no equivalent in the start-stop-daemon implementation from Debian. 

Thank you!

---

From: meow <[email-masked]>
Date: Tue, 21 Nov 2023 18:58:37 +0000

maybe. but where can I read README.Debian? 
This is the first I’m hearing of it.
Is it not better to mark these options as unsupported in the openrc-run manual page, or edit /lib/rc/sh/start-stop-daemon.sh to display a warning instead of passing the wrong options?

---

From: Mark Hindley <[email-masked]>
Date: Thu, 23 Nov 2023 19:57:20 +0000

>    maybe. but where can I read README.Debian?

/usr/share/doc/openrc/README.Debian

Mark

---

From: meow <[email-masked]>
Date: Fri, 24 Nov 2023 04:01:40 +0000

Thanks.
But are you sure users will read this file? Many do not even know that it exists.
I understand that this is more difficult, but such bad behavior clearly needs to be documented more visibly for the general user.
at least add the 'incompatible with start-stop-daemon' overlay against these options in the openrc-run manual page..

---

From: "Devuan bug Tracking System" <[email-masked]>
Date: Tue, 28 Nov 2023 10:50:02 +0000

This is an automatic notification regarding your bug report
which was filed against the openrc package:

#802: openrc: openrc-run: to many broken options

It has been closed by Mark Hindley <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Mark Hindley <[email-masked]> by
replying to this email.

-- 
802: https://bugs.devuan.org/cgi/bugreport.cgi?bug=802
Devuan Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#802: openrc: openrc-run: to many broken options
From: Mark Hindley <[email-masked]>
To: [email-masked]
Date: Tue, 28 Nov 2023 10:48:24 +0000

Version: 0.52.1-1

I have uploaded openrc 0.52.1-1 to Debian which addresses this by warning about
and ignoring openrc-run options that are incompatible with src:dpkg's
start-stop-daemon.

Mark

Subject: openrc: openrc-run: to many broken options
From: Lorietta <[email-masked]>
To: [email-masked]
Date: Sun, 19 Nov 2023 16:32:19 +1100

Package: openrc
Version: 0.45.2-2
Severity: normal

Dear Maintainer,

Starting myservice ...

-- System Information:
Distributor ID: Devuan

-- Configuration Files:

-- debconf-show failed