Adding sanity to OE startup process
Hello openembedded-devel,
I hope many people will agree that boot process is one of the pain
points of OE. Boot/service scripts are collected from Debian and other various sources, which are mostly intended for "desktop" systems, and doesn't really scale for embedded usage. For example, on typical desktop system you have:
1. Big screen and good chance to see a message before it scrolls away.
2. Ability to pause boot process from console with common Ctrl+S/Q.
3. Scrollback buffer.
All these are usually not available for embedded system (not
speaking that some embedded systems don't have screen at all).
So, to start with, I'd like to propose to make it possible for boot
process to log to syslog. I have following in mind:
1. Make a convention that boot/service scripts should use "$echo" instead of "echo" to do output.
2. Have default define of "echo=echo" for this.
3. Turn /etc/init.d/syslogd into /etc/init.d/syslogd.sh so it was sourced by /etc/init.d/rc and could export new value for the rest of scripts.
4. Make /etc/init.d/syslogd.sh start earlier so it could capture as mush output as possible.
5. Using syslogd for boot messages capture is of course optional.
Thanks,
Signature · 1 line
Paul mailto:[email protected]
Quoted 6 lines · Paul Sokolovsky
So, to start with, I'd like to propose to make it possible for boot
process to log to syslog. I have following in mind:1. Make a convention that boot/service scripts should use "$echo" instead of "echo" to do output.
2. Have default define of "echo=echo" for this.
I think some function should suffice. aliasing is possible too.
Function could be more flexible solution.
Quoted 3 lines
3. Turn
/etc/init.d/syslogdinto/etc/init.d/syslogd.shso it was sourced by/etc/init.d/rcand could export new value for the rest of scripts.
I don't see why.
Quoted 1 line
5. Using syslogd for boot messages capture is of course optional.
I don't see why.
We can log to multiple places.
All the best,
S.
Hello Sergey,
Quoted 10 lines · you
Quoted 6 lines · Paul Sokolovsky
So, to start with, I'd like to propose to make it possible for boot
process to log to syslog. I have following in mind:1. Make a convention that boot/service scripts should use "$echo" instead of "echo" to do output.
2. Have default define of "echo=echo" for this.I think some function should suffice. aliasing is possible too.
Function could be more flexible solution.
Well, yes, function would actually even better. I just wasn't sure
if rules for overriding builtins are portable enough. Well, I checked that it works for both bash and busybox.
Quoted 11 lines
Quoted 3 lines
3. Turn
/etc/init.d/syslogdinto/etc/init.d/syslogd.shso it was sourced by/etc/init.d/rcand could export new value for the rest of scripts.I don't see why.
Quoted 1 line
5. Using syslogd for boot messages capture is of course optional.
I don't see why.
We can log to multiple places.All the best,
S.
Signature · 2 lines
Best regards, Paul mailto:[email protected]
Quoted 5 lines · Paul Sokolovsky
So, to start with, I'd like to propose to make it possible for boot
process to log to syslog. I have following in mind:4. Make
/etc/init.d/syslogd.shstart earlier so it could capture as mush output as possible.
This is something that the syslog.file, syslog.buffer and syslog.network scripts in packages/slugos-init/files/initscripts try to do. Syslog to buffer is started *as* *early* as possible. Syslog to file is started as soon as filesystems are mounted, and Syslog to network is started as soon as the network is up.
[I'm not suggesting you copy those files directly, or use the slugos-init package - this all needs to be generalised and subsumed into the standard init package as part of the slugos reincorporation into general OE.]
The packages/initscripts/initscripts-slugos_1.0.bb file will show the init ordering changes that we did to make sure syslog started as early as possible to help with debugging on a machine (NSLU2) which does not have a user-visible console at all.
[Again, that recipe still needs to be subsumed into OE proper, so I will be very interested in working with you to effectively replace the initscripts-slugos recipe with a new improved initscripts recipe that suits everyone.]
-- Rod
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Rod Whitby schreef:
Quoted 4 lines
Quoted 3 lines · Paul Sokolovsky
So, to start with, I'd like to propose to make it possible for boot
process to log to syslog. I have following in mind:
Quoted 8 lines
Quoted 2 lines
4. Make
/etc/init.d/syslogd.shstart earlier so it could capture as mush output as possible.This is something that the syslog.file, syslog.buffer and syslog.network scripts in packages/slugos-init/files/initscripts try to do. Syslog to buffer is started *as* *early* as possible. Syslog to file is started as soon as filesystems are mounted, and Syslog to network is started as soon as the network is up.
Sounds pretty neat, does the buffer get flushed to file as well?
Speaking of the initsystem, can we make them more upstart/init-ng/system-du-jour friendly?
regards,
Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFGFW4SMkyGM64RGpERAlAZAKC5eS8M6hegNb8m/foqaQWwr2BcbwCeLaBF 3gwAI3XSdLSk8h72HZcVHyA=
=u3vx
-----END PGP SIGNATURE-----
Quoted 7 lines · Koen Kooi
Rod Whitby schreef:
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines · Paul Sokolovsky
So, to start with, I'd like to propose to make it possible for boot
process to log to syslog. I have following in mind:4. Make
/etc/init.d/syslogd.shstart earlier so it could capture as mush output as possible.
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
This is something that the syslog.file, syslog.buffer and syslog.network scripts in packages/slugos-init/files/initscripts try to do. Syslog to buffer is started *as* *early* as possible. Syslog to file is started as soon as filesystems are mounted, and Syslog to network is started as soon as the network is up.
Sounds pretty neat, does the buffer get flushed to file as well?
At the moment, no. You get to choose the destination in /etc/syslog.conf, and it only logs to that destination.
(e.g. if you need early debugging, you have to set it to buffer)
-- Rod
[...]
Even more good points, I think this would benefit from going to a more high level services description as well.
Regards,
:M:
Signature · 1 line
Michael 'Mickey' Lauer | IT-Freelancer | http://www.vanille-media.de
Hello Rod,
Quoted 13 lines · you
Quoted 5 lines · Paul Sokolovsky
So, to start with, I'd like to propose to make it possible for boot
process to log to syslog. I have following in mind:4. Make
/etc/init.d/syslogd.shstart earlier so it could capture as mush output as possible.This is something that the syslog.file, syslog.buffer and syslog.network scripts in packages/slugos-init/files/initscripts try to do. Syslog to buffer is started *as* *early* as possible. Syslog to file is started as soon as filesystems are mounted, and Syslog to network is started as soon as the network is up.
Quoted 4 lines
[I'm not suggesting you copy those files directly, or use the slugos-init package - this all needs to be generalised and subsumed into the standard init package as part of the slugos reincorporation into general OE.]
I expected SlugOS project to be important stakeholder for such
changes, so I appreciate your response, Rob! I had a look at slugos-init's syslog handling, and for sure it looks well done and should be generalized to the whole OE.
I guess, at this point, I should just play with it to understand
how it works better (for example, a question I have in mind: each of syslog.{buffer, file, network} appears to just run syslogd with new commandline params, not restart it or send signal; is this reliable (e.g. documented)? Well, as I tell, I should try it myself first I guess.)
[]
Quoted 1 line
-- Rod
Signature · 2 lines
Best regards, Paul mailto:[email protected]
Quoted 4 lines · Paul Sokolovsky
I expected SlugOS project to be important stakeholder for such
changes, so I appreciate your response, Rob! I had a look at slugos-init's syslog handling, and for sure it looks well done and should be generalized to the whole OE.
Thanks. It was mostly done by John Bowler. Any bugs introduced since then are my responsibility :-)
Quoted 6 lines
I guess, at this point, I should just play with it to understand
how it works better (for example, a question I have in mind: each of syslog.{buffer, file, network} appears to just run syslogd with new commandline params, not restart it or send signal; is this reliable (e.g. documented)? Well, as I tell, I should try it myself first I guess.)
Good question. I thought that only *one* of them would get started, based on the contents of the destination field in /etc/sysconf.conf at boot. Is that not what you're seeing?
-- Rod
Hello Rod,
Quoted 16 lines · you
Quoted 4 lines · Paul Sokolovsky
I expected SlugOS project to be important stakeholder for such
changes, so I appreciate your response, Rob! I had a look at slugos-init's syslog handling, and for sure it looks well done and should be generalized to the whole OE.Thanks. It was mostly done by John Bowler. Any bugs introduced since then are my responsibility :-)
Quoted 6 lines
I guess, at this point, I should just play with it to understand
how it works better (for example, a question I have in mind: each of syslog.{buffer, file, network} appears to just run syslogd with new commandline params, not restart it or send signal; is this reliable (e.g. documented)? Well, as I tell, I should try it myself first I guess.)
Quoted 3 lines
Good question. I thought that only *one* of them would get started, based on the contents of the destination field in
/etc/sysconf.confat boot. Is that not what you're seeing?
Sorry, for delay, due to approaching of 2.6.22 merge window, I
work mostly on HH.org kernel now, but yesterday finally found time to play with this issue.
So yes, I see that the idea after all is log to only one
destination, just start logging as soon as possible for that destination. I just had in mind something what Koen mentioned: start logging to buffer ASAP, then later switchover to file if needed, then to network if needed. Well, that's of course more of advanced feature.
Also, confirmed that file log rotation works at least with
busybox 1.2.1. Cleaned up syslogd.conf fixed to not contain confusing statements this is not supported, committed. Koen, what do you think about switching Angstrom's default setting to /var/log/messages after this, to make it easier for non-busybox people? After all, main trouble with file logging is now fixed - it cannot grow unlimited in size.
Quoted 1 line
-- Rod
Signature · 2 lines
Best regards, Paul mailto:[email protected]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Paul Sokolovsky schreef:
Quoted 7 lines
Also, confirmed that file log rotation works at least with
busybox 1.2.1. Cleaned up syslogd.conf fixed to not contain confusing statements this is not supported, committed. Koen, what do you think about switching Angstrom's default setting to/var/log/messagesafter this, to make it easier for non-busybox people? After all, main trouble with file logging is now fixed - it cannot grow unlimited in size.
Sounds ok to me.
regards,
Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFGLGdrMkyGM64RGpERAkElAJ9RHcBJaaY9CKMRE1jeGyrswP+x8wCgn6xk I4VGuh+YvrpQGCKlOaT/ufA=
=Msq4
-----END PGP SIGNATURE-----
Hello Koen,
Quoted 11 lines · you
Paul Sokolovsky schreef:
Quoted 7 lines
Also, confirmed that file log rotation works at least with
busybox 1.2.1. Cleaned up syslogd.conf fixed to not contain confusing statements this is not supported, committed. Koen, what do you think about switching Angstrom's default setting to/var/log/messagesafter this, to make it easier for non-busybox people? After all, main trouble with file logging is now fixed - it cannot grow unlimited in size.Sounds ok to me.
Patch posted at http://bugs.openembedded.org/show_bug.cgi?id=2135
Quoted 3 lines
regards,
Koen
Signature · 2 lines
Best regards, Paul mailto:[email protected]