Devuan bug report logs - #319
openrc savecache doesnt run start()

Package: openrc; Reported by: dxrobertson <dxrobertson@gmail.com>;
Date: Tue, 23 Apr 2019 11:33:01 UTC;
Maintainer for openrc is (unknown).

View this report as an mbox folder.


Report forwarded to devuan-bugs@lists.dyne.org, owner@bugs.devuan.org:
bug#319; Package openrc. Full text available.



Acknowledgement sent to dxrobertson <dxrobertson@gmail.com>:
New bug report received and forwarded. Copy sent to owner@bugs.devuan.org. Full text available.



Message received at submit@bugs.devuan.org:

From: dxrobertson <dxrobertson@gmail.com>
Date: Tue, 23 Apr 2019 07:29:14 -0400
Subject: openrc savecache doesnt run start()
To: submit@bugs.devuan.org

[Message part 1 (text/plain, inline)]

Package: openrc

Version: 0.40.3-1

Severity: normal



Dear Maintainer,


The start() routine in /etc/init.d/savecache does not run. If you run my

attached savecache (rc-service savecache start), "SAVECACHE TEST GOT HERE"
will

be displayed, but "SAVECACHE TEST NOT GETTING HERE" will not be displayed.
The start() routine is never entered.


The problem stems from the LSB header information in savecache. These lines
of

code are somehow confusing openrc-run, openrc-run never runs start().


If the LSB header info is removed, savecache runs fine; start() is then run.




Next issue, is savecache even needed? It appears this script is to run in

runlevel off at shutdown, to save /run/openrc/deptree and
/run/openrc/softlevel

to /lib/rc. Arent deptree and softlevel always re-generated at startup
anyway?

Are these cached files in /lib/rc ever used?




Next, if the cached files are used and needed, wouldnt /var/cache be a
better

home for them, something like /var/cache/openrc?




-- System Information:

Distributor ID: Devuan

Description: Devuan GNU/Linux beowulf/ceres

Release: 10

Codename: n/a

Architecture: x86_64


Kernel: Linux 4.19.0-4-amd64 (SMP w/4 CPU cores)

Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)

Shell: /bin/sh linked to /bin/dash

Init: sysvinit (via /sbin/init)

LSM: AppArmor: enabled

Versions of packages openrc depends on:

ii init-system-helpers 1.56+devuan1

ii insserv 1.18.0-2

ii libaudit1 1:2.8.4-2

ii libc6 2.28-8

ii libeinfo1 0.40.3-1

ii libpam0g 1.3.1-5

ii librc1 0.40.3-1

ii libselinux1 2.8-1+b1

openrc recommends no packages.


Versions of packages openrc suggests:

pn policycoreutils <none>

ii sysvinit-core 2.93-8+devuan1

[Message part 2 (text/html, inline)]



[savecache (application/octet-stream, attachment)]






Information forwarded to devuan-bugs@lists.dyne.org, owner@bugs.devuan.org:
bug#319; Package openrc. Full text available.



Acknowledgement sent to dxrobertson <dxrobertson@gmail.com>:
Extra info received and forwarded to list. Copy sent to owner@bugs.devuan.org. Full text available.



Message received at 319@bugs.devuan.org:

From: dxrobertson <dxrobertson@gmail.com>
Date: Wed, 24 Apr 2019 17:58:05 -0400
Subject: openrc savecache doesnt run start()
To: 319@bugs.devuan.org

I believe the problem to be in openrc-run.sh, the code at/around line 245:

# Load our script
lsbh=$(lsb2rcconf "$RC_SERVICE")
if [ -n "${lsbh}" ]; then
eval "${lsbh}"
else
sourcex "$RC_SERVICE"
.
.
.


I ran rc-service with the -d debug option:
rc-service -dv savecache start
Both with the LSB header present and not present, in /etc/init.d/savecache.

When running WITH the LSB header present, variable lsbh becomes:
+ lsb2rcconf /etc/init.d/savecache
+ lsbh=depend () {
        provide _all
}
And subsequently, the code at line 247 gets run:
if [ -n "${lsbh}" ]; then
eval "${lsbh}"
(This is the problem where savecache start() doesnt get run)

When running WITHOUT the LSB header present, variable lsbh becomes:
+ lsb2rcconf /etc/init.d/savecache
+ lsbh=
And subsequently, the "else" code at line 249 gets run:
else
sourcex "$RC_SERVICE"
.
.
.
(savecache start() runs)

To resolve the problem, the LSB header could simply be removed from
/etc/init.d/savecache.

I wonder why LSB is being examined at all in openrc-run scripts, I
thought (wrongly?) that LSB support was only added for /bin/sh run
scripts, so to use the sysvinit scripts without modification, in
openrc.





Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.

Devuan Bugs Owner <owner@bugs.devuan.org>.
Last modified: Thu, 17 Oct 2019 13:15:22 UTC