Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] init woes

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Seth Woolley <seth AT tautology.org>
  • To: Jeremy Kolb <jkolb AT brandeis.edu>
  • Cc: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] init woes
  • Date: Wed, 8 Oct 2003 14:58:35 -0700 (PDT)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I hope it wasn't moved into test yet. Oh well, do this to fix:

smgl_functions
89a90
> export -f logger_func
132a134
> export -f print_status

or wait for the next tarballing.

the reason why it prints success four times is because the init script was
buggy to begin with. The new format only shows you how buggy the old
script is because it doesn't line-up-print-status four times in a row
which is unneeded status printing. I'm open to suggestions for a better
way to print paralleled status. In parallel init, you can't just print
[ OK ] on the same line due to the fact that you don't know what the OK
was for if things can run in parallel.

I suppose I could check for sequential init, but since the move up print
status is also printing anyways, I don't see how it can be faster.
Yes, prepending with 'init.d: ' may be overkill, so I removed that now,
and scripts have color anyways, so you should know if it came from init.d.

Now, it might be slower because of the system logger code (that was in
there before though), but for good measure, I made it optional, so there's
no fork needed for that.

Perhaps success should be silent and only failures should be printed (but
you wouldn't know if one script hung since you didn't not see success), or
I could have it remember the last line printed for each script and have
status go up the number of lines needed, print [ OK ] on the right
side of it, then go back down a number of lines, but I would think that
might be slower, even if it looks pretty.

Another alternative is to have it print [ alsa: OK ] on the right
side. The way I did it was quite simple, I thought, even though one may
think it's not as pretty.

The major gotcha so far is that echo used for anything other than printing
to the screen needs to be "builtin echo" in init scripts since it occurs
much more often as sent to the screen than as piped through another
binary. When running sub-scripts, also, if one doesn't want the echo
override to inherit, one needs to "(unset -f echo; subscript)" instead of
running the subscript directly.

Almost all standard init scripts work fine with it though.

Hope that helps.

Seth

On Wed, 8 Oct 2003, Jeremy Kolb wrote:

> So my xscreensaver decided to lock up my system (think it's the nvidia
> drivers), and so I had to reboot. When I did, I noticed that the output
> to the init stuff had changed. While I understand why the change was
> made it looks kind of ugly to me. Also, it seems like everything takes
> longer to load because more text is placed on the screen, and somethings
> are displayed twice (samba has a "success" a total of four times) and
> gdm comes up with about twenty of these: "line 10: printstatus not
> found" or something like that.
>
> I understand that this was changed so that we could have services start
> in parallel, but is there anyway we could have the old behavior stay for
> the sequential init? Or modify what we have now as it's a little slower
> and not as pretty?
>
> I'm just trying to think this through and I respect the work that's gone
> into this (don't take this the wrong way!).
>
> Jeremy
>
> _______________________________________________
> SM-Discuss mailing list
> SM-Discuss AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/sm-discuss
>

- --
Seth Alan Woolley <seth at tautology.org>, SPAM/UCE is unauthorized
Key id 7BEACC7D = 2978 0BD1 BA48 B671 C1EB 93F7 EDF4 3CDF 7BEA CC7D
Full Key at seth.tautology.org and pgp.mit.edu. info: www.gnupg.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQE/hIiP7fQ833vqzH0RAmBZAJ99vnkiqu/gb8xOb2ZuZdXyjFpkvQCfSLvj
R8GmNhxLxaRM+/umEBOGTZc=
=DMW8
-----END PGP SIGNATURE-----





Archive powered by MHonArc 2.6.24.

Top of Page