summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-12-06 11:16:27 +0000
committerRoy Marples <roy@marples.name>2007-12-06 11:16:27 +0000
commit17585a3c044f942e838eb928c24511eaea5c25ba (patch)
tree81281e7c34fb33991ea1abd341db94d8e35bad01 /src
parentd3436344eeed79fcb9b0d59d3d9231bad31b310a (diff)
downloadopenrc-17585a3c044f942e838eb928c24511eaea5c25ba.tar.gz
openrc-17585a3c044f942e838eb928c24511eaea5c25ba.tar.bz2
openrc-17585a3c044f942e838eb928c24511eaea5c25ba.tar.xz
Don't be spammy or interactive when we don't output
Diffstat (limited to 'src')
-rw-r--r--src/rc.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/rc.c b/src/rc.c
index c20a760..8da7059 100644
--- a/src/rc.c
+++ b/src/rc.c
@@ -495,6 +495,9 @@ static bool want_interactive (void)
static bool gotinteractive;
static bool interactive;
+ if (rc_yesno (getenv ("EINFO_QUIET")))
+ return (false);
+
if (PREVLEVEL &&
strcmp (PREVLEVEL, "N") != 0 &&
strcmp (PREVLEVEL, "S") != 0 &&
@@ -958,7 +961,8 @@ int main (int argc, char **argv)
signal (SIGUSR1, handle_signal);
signal (SIGWINCH, handle_signal);
- interactive = exists (INTERACTIVE);
+ if (! rc_yesno (getenv ("EINFO_QUIET")))
+ interactive = exists (INTERACTIVE);
rc_plugin_load ();
/* Check we're in the runlevel requested, ie from
@@ -989,7 +993,8 @@ int main (int argc, char **argv)
ecolor (ECOLOR_GOOD), ecolor (ECOLOR_HILITE),
ecolor (ECOLOR_NORMAL));
- if (rc_conf_yesno ("rc_interactive"))
+ if (! rc_yesno (getenv ("EINFO_QUIET")) &&
+ rc_conf_yesno ("rc_interactive"))
printf ("Press %sI%s to enter interactive boot mode\n\n",
ecolor (ECOLOR_GOOD), ecolor (ECOLOR_NORMAL));
@@ -1233,12 +1238,17 @@ int main (int argc, char **argv)
We have different rules dependent on runlevel. */
if (newlevel && strcmp (newlevel, bootlevel) == 0) {
if (coldplugged_services) {
- einfon ("Device initiated services:");
+ bool quiet = rc_yesno (getenv ("EINFO_QUIET"));
+
+ if (! quiet)
+ einfon ("Device initiated services:");
STRLIST_FOREACH (coldplugged_services, service, i) {
- printf (" %s", service);
+ if (! quiet)
+ printf (" %s", service);
rc_strlist_add (&start_services, service);
}
- printf ("\n");
+ if (! quiet)
+ printf ("\n");
}
tmplist = rc_services_in_runlevel (newlevel ? newlevel : runlevel);
rc_strlist_join (&start_services, tmplist);