Article View: news.software.readers
Article #109537Re: [slrn] Getting It To Run At All [OT]
From: Blinky the Shark
Date: Fri, 13 Sep 2002 06:25
Date: Fri, 13 Sep 2002 06:25
102 lines
6132 bytes
6132 bytes
G. Wolfe Woodbury wrote: > Blinky the Shark <no.spam@box.invalid> shaped electrons to say: > >> See <looking around>, <whispering> I haven't yet found out where >> environment variables are set, *other than* from the prompt. I'd >> just set the bastage from autoexec....OOPS.....from somewhere that >> gets read on boot, if'n I could. > > IT all begins with 'init'. The boot sequence loads the kernel and > transfers control to it. Among the first few things the kernel does > at boot time (along with initializing memory management and the > devices) is > to craft the first "processes" in non-kernel memory. This is done > specially because the newly booted kernel can't call 'exec' yet. > > This first process is called 'init' and lives in /sbin/init. Some > other processes are created by the kernel as well, but they aren't > relevant to userland operation. > > Init sets "PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin" > (snipped right out of the strings(1) examination of /sbin/init). > > Init then examines the /etc/inittab file, and starts creating other > processes based on the information it reads there. Some of the entries > in inittab(5) call the sysinit scripts, which set up various other > system services and daemons. Other entries run "gettys" on the > consoles. > > The getty family program monitors the console (or serial line) device > file waiting for something to happen. For the Linux consoles, it > displays a banner and issues the "login: " prompt and waits for > keyboard > action. The getty sets some more environment variables, among them is > TERM. /sbin/mgetty is an example of the getty programs. (There is a > lot more that the getty does, including FAX reception.) > > The getty passes the username it gets from the login: prompt along to > the /bin/login program. login(1) proceeds to reset the environment > and > do various accounting and housekeeping tasks. It reads the > /etc/passwd entry for the given username, sets PATH (again) and some Quick - I hope - digression: Hmmm. My password itself doesn't appear to be in that file, which makes sense (to the newb) because its in a public location. Now, I certainly don't know what I *do* see in there <g>, but if "how it gets that password from there" can be explained for such a newb, I'd be interested. > other variables, collects the password and checks it, establishes the > stdin, stdout and stderr files, and (finally) calls the user's shell. > > Bash then does a few things to get itself going. Here is an excerpt > from the bash(1) manual page: > > When bash is invoked as an interactive login shell, or as a > non-interactive shell with the --login > option, it first reads and executes commands from the file > /etc/profile, if that file exists. After > reading that file, it looks for ~/.bash_profile, ~/.bash_login, > and ~/.profile, in that order, and reads > and executes commands from the first one that exists and is > readable. The --noprofile option may be used > when the shell is started to inhibit this behavior. > > Then bash starts waiting for commands and fork/exec's them. Note that > the sequence from getty to shell is done by each program "exec"ing its > successor, meaning that the same "process" simply starts running new > code. To "fork" means that a new process is created, and that usually > exec's the new code. The distinction is somewhat critical. > > Now you may have more than you wanted to know. Actually, I do *pretty much* follow what you've laid out, and I very much appreciate it. I wanted to say that first, so I've broken out of my normal interposting style (with the one exception you've seen). And I'm not snipping, despite netiquette understanding, because we're going back up there, now <g>.... From that intro, and the matter most directly at hand (getting an environment variable - NNTPSERVER - set without having to enter it from the command line prior to running slrn), it looks like one of the the /.bash* files would be where I'd go, as the preceeding stuff apparently isn't user-specific (access via pwd aside). And somebody mentioned two of them, earlier. Now, not knowing much about this, but having fiddled with the NNTPSERVER stuff that works at the command line, I tried sticking in a couple versions of the commands that bash suggests when I run slrn (and at least one of them does work from the prompt). Nothing that I know of broke, but I was still prompted to set that variable upon trying to run slrn. The example (I think it was a PATH setting) I saw appeared to be a two-part process (as did one of the command line settings): declare it, then export it (Hah! Like I have any idea where it 1) is, or 2) is being exported to. <g>). That's what I emulated. A NNTPSERVER='foo' line and an "export NNTPSERVER" line. I sense I'm in the ballpark, but I can't quite see who's on first. -- Blinky
Technical Details
Message-ID:
<2958797.5XrB3nSB3S@blinkynews.invalid>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!pln-w!spln!dex!extra.newsguy.com!newsp.newsguy.com!enews3References:
<slrnantp90.8s2.tim@vegeta.ath.cx> <slrnao0mar.np6.tim@vegeta.ath.cx> <7760280.40QTL0fHMe@blinkynews.invalid> <slrnao2igg.ik7.ggw_@wolves.homeip.net>Show Full Headers
Complete Article Headers
Message-ID: <2958797.5XrB3nSB3S@blinkynews.invalid> Subject: Re: [slrn] Getting It To Run At All [OT] Date: Thu, 12 Sep 2002 23:25:36 -0700 From: Blinky the Shark <no.spam@box.invalid> References: <slrnantp90.8s2.tim@vegeta.ath.cx> <slrnao0mar.np6.tim@vegeta.ath.cx> <7760280.40QTL0fHMe@blinkynews.invalid> <slrnao2igg.ik7.ggw_@wolves.homeip.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!pln-w!spln!dex!extra.newsguy.com!newsp.newsguy.com!enews3 Newsgroups: news.software.readers Organization: http://web.newsguy.com/dogfish Lines: 101 NNTP-Posting-Host: p-637.newsdawg.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.6.1 X-OS: Mandrake Linux 8.2 X-Face: Jb-wQ7r&vrN}~8MC5B09S4&.ieh!Q:Di/XN.xrd#CU%;)bPa`Hm^(,3o$n(s75[P+$F+Q^4~Owj`WzkBtZU/#gL2BvEBm/e=/1,R0}d@q@)E