Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 93954 - Want mechanism to disable runscript.sh's --quiet option
Summary: Want mechanism to disable runscript.sh's --quiet option
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-25 09:03 UTC by Paul Komarek
Modified: 2006-05-18 07:23 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Komarek 2005-05-25 09:03:08 UTC
I find there are times (many times) when the hard-coded --quiet switch to
runscript.sh makes debugging initscripts much harder than necessary.  I either
remove --quiet from the initscript or edit /sbin/runscript.sh to disable --quiet
altogether.  Both cause problems when updating world.

It seems that it would be easy to add a runscript configuration file in
/etc/conf.d.  This is appropriate because /etc/conf.d has file setting startup
options for initscripts, and runscript is part of every Gentoo initscript I've
seen.  I don't know what options would be exposed, but I'm hoping for one in
particular:  FORCE_RC_QUIET_STDOUT="no" (or "yes", if the person always wants
--quiet behavior).

runscript.sh would need to source /etc/conf.d/runscript, and lines 442-444 might
change to:

        --quiet)
                RC_QUIET_STDOUT="yes"
                if [ -z "FORCE_RC_QUIET_STDOUT" ]; then
                    RC_QUIET_STDOUT="$FORCE_RC_QUIET_STDOUT"
                fi
                ;;

Of course, there are many other ways to handle this, such as not parsing --quiet
if FORCE is set and RC_QUIET_STDOUT was initialized to the FORCEd value.

Hopefully I am not the only Gentoo user that prefers full disclosure from their
operating system, as opposed to hiding kernel and other startup messages behind
cute pictures of Tux (he's on my credit card, I don't need a boot splash) or
surpressing them completely.  If I *am* the only Gentoo user that wants to
control --quiet, then probably this request should be ignored. =-)

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Paul Komarek 2005-05-25 09:04:20 UTC
Whoops, my example script should have used [ -n "$..." ] instead of [ -z "$..."
].  I think I need a preview button on bugzilla.
Comment 2 SpanKY gentoo-dev 2005-05-25 12:51:09 UTC
what hardcoded --quiet ?  i dont see any such beast in baselayout ...
Comment 3 Paul Komarek 2005-05-25 14:59:40 UTC
I apologize for my lack of clarity.  The initscripts that hardcode --quiet when
calling start-stop-daemon (also in baselayout).  I guess I was under the
(probably wrong) impression that runscript.sh had something to do with it
because it interprets the initscripts.

So I still think that baselayout is the right place to make my suggested change,
if it belongs anywhere.  Certainly we should *not* handle this uniform task
(enabling/disabling) individually in every initscript.
Comment 4 SpanKY gentoo-dev 2005-05-25 17:28:59 UTC
in other words, you want us to patch start-stop-daemon.c to ignore the --quiet
optoin if an env var is set ?
Comment 5 Paul Komarek 2005-05-25 17:35:38 UTC
I suppose it has to be an environment variable, unless we create a
start-stop-daemon config file.  Which might not be a bad idea.
Comment 6 Joshua Kinard gentoo-dev 2005-05-25 19:31:31 UTC
I can see where this might be useful.  I've had more than one instance where a
daemon (usually sshd) doesn't want to start up (prints [!!] as its status), and
I'm left a bit puzzled as to the reason why, so I had to edit the initscript to
remove the --quiet param so I could get an idea of what was h0rking it.
Comment 7 SpanKY gentoo-dev 2005-05-25 19:47:35 UTC
weeeeeeeeell i fixed the sshd init script to just run `sshd` since the usage of
start-stop-daemon with ssh was pointless :)
Comment 8 Paul Komarek 2005-05-25 20:52:14 UTC
A fine point about sshd.  That said, I want to mention that I would still like
this feature for many other initscripts.

Would this feature be trivial to add?
Comment 9 Paul Komarek 2005-05-25 21:20:40 UTC
I just had a look at start-stop-daemon.c.  It seems that there may be other
parameters besides --quiet (or --verbose) that a person might want to override.
 For overriding command-line values, I would think that you would call an env
var checking function just after parse_options() is called from main().  If you
wanted to be able to change the default value of an option, you could call the
same or a similar function before parse_options().  Since there's no options
struct, everything is global (was this translated straight from Debian's perl
version?).  This means that set_default_options() and override_options()
functions don't even need to take parameters.

Normal unix-ish behavior is to have command-line options override env vars, yes?
 So we might want to choose an env var name that makes it clear we are
overriding command-line values.  Some ideas might be SSD_FORCE_QUIETMODE,
SSD_ALWAYS_QUIETMODE, or SSD_OVERRIDE_QUIETMODE . You could also have
SSD_DEFAULT_QUIETMODE, etc.  A single env var parser

  parse_env_options(int default)

would grab all vars with SSD_, then check the second token for default or
override (whatever), and then set the global variable.  If default != 0, then it
would only read things with DEFAULT for the second token.

Just an idea.  Those env var names I made up were pretty long; maybe there's
good and short names we can come up with.
Comment 10 Roy Marples (RETIRED) gentoo-dev 2005-06-03 06:24:22 UTC
baselayout-1.12.0-alpha2 has a working /lib/rcscripts/rc-daemon.sh which acts as
a wrapper to start-stop-daemon.

It could easily be accomodated to filter/add flags to the s-s-d calls

RC_SSD_MESSAGES="verbose|quiet"

As the two are mutually exclusive the following actions would be taken
RC_SSD_MESSAGES="" - let the init script work as normal
RC_SSD_MESSAGES="verbose" - add the verbose flag if not present and remove the
quiet flag if present
RC_SSD_MESSAGES="quiet" - add the quiet flag if not present and remove the
verbose flag if present

Another alternative would be to use the existing RC_QUIET_STDOUT and RC_VERBOSE
vars in /sbin/functions.sh - although I would be in favour of renaming
RC_QUIET_STDOUT to just RC_QUIET in this case.
Comment 11 Roy Marples (RETIRED) gentoo-dev 2006-05-18 07:23:14 UTC
After much thought, I believe that this should be implemented on a per init script basis as most init script authors are using --quiet when there really is no need for it. Infact, most daemons have switches to disable chatter which should be used instead.

I'm going to close WONTFIX. If you want this, then please open bugs for the packages where you would like this removed from.