Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 646518 - =media-tv/gentoo-vdr-scripts-2.7.3 fails to shutdown pc for sleep b/c /etc/conf.d/clock not exists...
Summary: =media-tv/gentoo-vdr-scripts-2.7.3 fails to shutdown pc for sleep b/c /etc/co...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo VDR Project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-02-03 21:46 UTC by Mark Dominik Bürkle
Modified: 2019-12-15 01:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch (including whitespace-changes) to re-permit automated shutdown with vdr (pre-shutdown-90-systohc.sh.patch,793 bytes, patch)
2018-02-03 21:49 UTC, Mark Dominik Bürkle
Details | Diff
patch (excluding whitespace-changes) to re-permit automated shutdown with vdr (pre-shutdown-90-systohc.sh.ws-ignored.patch,400 bytes, patch)
2018-02-03 21:50 UTC, Mark Dominik Bürkle
Details | Diff
patch to suppress "[: : ganzzahliger Ausdruck erwartet" / "[: : integer expression expected" (vdrshutdown-really.sh.patch,498 bytes, patch)
2018-02-03 22:01 UTC, Mark Dominik Bürkle
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Dominik Bürkle 2018-02-03 21:46:57 UTC
werkraumpc ~ # cat pre-shutdown-90-systohc.sh.ws-ignored.patch 
--- /usr/share/vdr/shutdown/pre-shutdown-90-systohc.sh 2018-02-03 21:49:38.516984206 +0100
+++ /usr/share/vdr/shutdown/pre-shutdown-90-systohc.sh 2018-02-03 21:39:21.397421974 +0100
@@ -1,6 +1,6 @@
 # $Id: 5783cb343138def65e48b0b28a4b1f97a68f88d9 $
 
-if [ ! -f /etc/init.d/sysfs ]; then
+if [ ! -f /etc/init.d/sysfs ] && [ -f /etc/conf.d/clock ]; then
 # Baselayout 1
 . /etc/conf.d/clock
     else
werkraumpc ~ # 


On this system, /etc/init.d/sysfs has been removed [What's it part of? openrc?].

So, the "-f" test fails and "test ! -f sysfs" returns true, /etc/conf.d/clock is tried to be sourced, which fails (with $? == 1).
This might lead to aborted execution of the script (resulting in a $? == 1).
If that's ignored, then in the script,
  if yesno "${SHUTDOWN_SYSTOHC:-no}"; then
is executed and will return false, i.e. $? == 1, next, and as a script return value.


I will append a patch for pre-shutdown-90-systohc.sh next.
Comment 1 Mark Dominik Bürkle 2018-02-03 21:49:42 UTC
Created attachment 517692 [details, diff]
patch (including whitespace-changes) to re-permit automated shutdown with vdr
Comment 2 Mark Dominik Bürkle 2018-02-03 21:50:28 UTC
Created attachment 517694 [details, diff]
patch (excluding whitespace-changes) to re-permit automated shutdown with vdr
Comment 3 Mark Dominik Bürkle 2018-02-03 22:01:13 UTC
Created attachment 517698 [details, diff]
patch to suppress "[: : ganzzahliger Ausdruck erwartet" / "[: : integer expression expected"

werkraumpc ~ # su - vdr
vdr@werkraumpc ~ $ sudo /usr/share/vdr/bin/vdrshutdown-really.sh 1517704200 15112 9 Sphere 0
/usr/share/vdr/bin/vdrshutdown-really.sh: Zeile 50: [: : Ganzzahliger Ausdruck erwartet.
/usr/share/vdr/shutdown/pre-shutdown-90-systohc.sh: Zeile 5: /etc/conf.d/clock: Datei oder Verzeichnis nicht gefunden
vdr@werkraumpc ~ $
Comment 4 Mark Dominik Bürkle 2018-02-03 22:08:27 UTC
This is for all the users that have

Feb 03 22:08:14 werkraumpc vdr[297]: [297] connect from 127.0.0.1, port 48584 - accepted
Feb 03 22:08:14 werkraumpc vdr[297]: [297] SVDRP message: 'sudo failed: call emerge --config gentoo-vdr-scripts'
Feb 03 22:08:14 werkraumpc vdr[297]: [297] info: sudo failed: call emerge --config gentoo-vdr-scripts
Feb 03 22:08:14 werkraumpc vdr[297]: [297] closing SVDRP connection
Feb 03 22:10:01 werkraumpc cron[23555]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons)


in their logs respectively on their tv screens. Calling "emerge --config gentoo-vdr-scripts" does not help (yet). :-(

KR,
Dominik
Comment 5 Jonas Stein gentoo-dev 2018-02-05 09:57:31 UTC
thank you for the patch. 
Please use LANG=C next time, so that errors are not translated into german.
Comment 6 Joerg Bornkessel gentoo-dev 2018-09-04 11:56:05 UTC
Mark D., thanks for reporting this

i am stucking around on this stupid bug
the test do exactly for what is it written for.

my question is: Do you use systemd?

In this case the test will fails, of course.

A short look on the history of the gentoo-vdr-scripts
- we fixed at first the baselayout1/2 changes
- a lot of month later(or years?), we added the systemd crap support

looks like, we missed to adjust this part

i will remove the baselayout1/2 test from the sripts, as we don't have 
baselayout 1 any more

this will fixed in the next gentoo-vdr-scripts release

please keep your changes at first localy
Comment 7 Joerg Bornkessel 2019-11-12 22:37:23 UTC
Mark D.
is fixed and will commit in the next few days

gentoo-vdr-script-2.8


Big, big sorry for the long delay time
Comment 8 Larry the Git Cow gentoo-dev 2019-12-15 01:06:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=832251698a5928764e2aeb6486cbb07f82a42944

commit 832251698a5928764e2aeb6486cbb07f82a42944
Author:     Joerg Bornkessel <hd_brummy@gentoo.org>
AuthorDate: 2019-12-15 01:05:14 +0000
Commit:     Joerg Bornkessel <hd_brummy@gentoo.org>
CommitDate: 2019-12-15 01:05:14 +0000

    media-tv/gentoo-vdr-scripts: bump to 2.8
    
    this bump will fix:
    SYMLINK_LIB=no / 17.1 profiles break VDR plugins
    fails to shutdown pc for sleep
    shuts the vdr down even if nvram-wakup fails
    disabled login for user vdr
    ebuild cleanup
    cleanup old
    
    Bug: https://bugs.gentoo.org/688174
    Bug: https://bugs.gentoo.org/646518
    Bug: https://bugs.gentoo.org/298785
    Closes: https://bugs.gentoo.org/688174
    Closes: https://bugs.gentoo.org/646518
    Closes: https://bugs.gentoo.org/298785
    Package-Manager: Portage-2.3.81, Repoman-2.3.18
    Signed-off-by: Joerg Bornkessel <hd_brummy@gentoo.org>

 media-tv/gentoo-vdr-scripts/Manifest               |   6 +-
 .../gentoo-vdr-scripts-2.0.0.ebuild                | 130 --------------------
 .../gentoo-vdr-scripts-2.5.ebuild                  | 133 --------------------
 .../gentoo-vdr-scripts-2.7.2.ebuild                | 135 ---------------------
 .../gentoo-vdr-scripts-2.7.5.ebuild                | 130 --------------------
 .../gentoo-vdr-scripts-2.7.ebuild                  | 135 ---------------------
 .../gentoo-vdr-scripts-2.8.ebuild                  |  82 +++++++++++++
 7 files changed, 83 insertions(+), 668 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=832251698a5928764e2aeb6486cbb07f82a42944

commit 832251698a5928764e2aeb6486cbb07f82a42944
Author:     Joerg Bornkessel <hd_brummy@gentoo.org>
AuthorDate: 2019-12-15 01:05:14 +0000
Commit:     Joerg Bornkessel <hd_brummy@gentoo.org>
CommitDate: 2019-12-15 01:05:14 +0000

    media-tv/gentoo-vdr-scripts: bump to 2.8
    
    this bump will fix:
    SYMLINK_LIB=no / 17.1 profiles break VDR plugins
    fails to shutdown pc for sleep
    shuts the vdr down even if nvram-wakup fails
    disabled login for user vdr
    ebuild cleanup
    cleanup old
    
    Bug: https://bugs.gentoo.org/688174
    Bug: https://bugs.gentoo.org/646518
    Bug: https://bugs.gentoo.org/298785
    Closes: https://bugs.gentoo.org/688174
    Closes: https://bugs.gentoo.org/646518
    Closes: https://bugs.gentoo.org/298785
    Package-Manager: Portage-2.3.81, Repoman-2.3.18
    Signed-off-by: Joerg Bornkessel <hd_brummy@gentoo.org>

 media-tv/gentoo-vdr-scripts/Manifest               |   6 +-
 .../gentoo-vdr-scripts-2.0.0.ebuild                | 130 --------------------
 .../gentoo-vdr-scripts-2.5.ebuild                  | 133 --------------------
 .../gentoo-vdr-scripts-2.7.2.ebuild                | 135 ---------------------
 .../gentoo-vdr-scripts-2.7.5.ebuild                | 130 --------------------
 .../gentoo-vdr-scripts-2.7.ebuild                  | 135 ---------------------
 .../gentoo-vdr-scripts-2.8.ebuild                  |  82 +++++++++++++
 7 files changed, 83 insertions(+), 668 deletions(-)