On Fri, Dec 14, 2001 at 06:21:16PM +0100, Israel Alvarez wrote: > Hi!, > I'm developing one app. over White Dwarf Linux. for an embedded system. I > needed to find the way of loggin into the system without user and password > request because the final product will not have any input device. The > solution I have found is to modify the /etc/rc.d/rc.local file so it launches > my app. even before the system request for the prompt. At the moment it > works, but I'm not sure if it is the right way (actually, I think It's not > the right way). I guess I will find problems shooting down the system for > example. Could anyone give me his/her oppinion about this? If this is not the > right way, How can I skip the loggin request? (I don't have the Perl library > installed so I can't use the 'autologin' application for example. By the way, > because lack of room in the system I would prefer don't use any extra app. if > it is possible). > thanks
Under UNIX/Linux /bin/login is just a userspace program. There are no special requirements for it. There is nothing wrong with eschewing the normal login process and having init spawn of your embedded applications directly; and there is nothing wrong with having those applications bound to a console, serial TTY line or other, user interactive, communications channel. Note that you may have to provide a small wrapper, or a mod to your program, to initialize the terminal settings on the appropriate device (if it's not the "system console"). Also note that the Linux login programs (there are a few different ones) do perform so maintenance of the /var/run/utmp and /var/log/wtmp files (tracking "who" is currently logged in for the "who" and "w" commands and when they logged in and out for the "last" command; for example). Most embedded applications have NO need for these so that's probably not important to you. By all means read the sources to your /bin/login command if you're worried that you might be missing something. Of course the stock Debian "login" program (from their login package) is about 1200 lines long; but quite a bit of that is #IFDEFs for various configuration options and portability to other versions of UNIX. Also it's localized (using the GNU gettext system) so most (all?) of the string parameters are written in the _(....) form (note the leading underscore). This is (conventionally) a macro to identify and isolate all the "gettext"-able strings for later localization. There there's a bunch of P_((.....)) parameterization, which I've seen in GNU library sources before, and I still don't quite grok. (I think it may be to support some mutant versions of UNIX or cc where the prototypes are not allowed to include their parameter list, or where the parameter list has to be handled specially. I'd love an explanation). Most of the code in main() is also in #IFDEFs for PAM, Shadow, Kerberos, RADIUS, etc, and quite alot is for handling ulimits and login.defs stuff, password aging, and handling things like motd (message of the day) and /etc/nologin (prevent normal users from logging in during system maintenance) etc. Actually, all in all, that is one UGLY piece of code. Of course there are far simpler versions of login. You might look at busybox for something that's simpler, tuned more for embedded applications and considerably smaller. I'd provide a URL but my DSL line went down, and I haven't gone to the bother of getting my modem/PPP backup line wired up! -- Jim Dennis -- To unsubscribe from this list, send a message to [EMAIL PROTECTED] with the command "unsubscribe linux-embedded" in the message body. For more information, see <http://waste.org/mail/linux-embedded>.
