Linux-Misc Digest #715, Volume #25               Sun, 10 Sep 00 03:13:04 EDT

Contents:
  Re: how to logout from inside a script or app? ("Peter T. Breuer")
  Re: So Complicated I Dont Even Know What To Catagorize It As ("Peter T. Breuer")
  Re: Partition Cross-Over Project: Extended to Primary ("Peter T. Breuer")
  Re: Locate inititlization does not complete ("Peter T. Breuer")
  Re: how can I delete blank line? ("Peter T. Breuer")

----------------------------------------------------------------------------

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: how to logout from inside a script or app?
Date: 10 Sep 2000 06:07:11 GMT

Jerry L Kreps <[EMAIL PROTECTED]> wrote:
: "Peter T. Breuer" wrote:
:> 
:> Jerry L Kreps <[EMAIL PROTECTED]> wrote:
:> : I've tried the system() function and got nowhere.
:> : I don't want to put my code at the bottom of ~/.profile or ~/.bashrc but .....
:> 
:> What do you mean by "logout"? Don't you just mean "exit the login
:> shell" 

: Exactly.  A user dials in (answered via mgetty) and is presented the
: login screen. Standard stuff.  After logging in, by using their account
: name and password, a console is presented.  
: I don't want them having access to the command line in a console.  So, I
: am writing a little program that is going to be called on the last line
: of ~/.bashrc (SuSE).  It will present a menu of options, one of which is
: to 'Quit'.  When they select 'Quit' I want the session to close and the
: login screen to return.  What I DON'T want to happen is them hanging up
: but their shell staying open.

: Am I clear now?

Yes. Well, even if they hung up properly they could have started
programs that still continue when they are gone, an extra shell detached
from any i/o is no problem. But I suppose you want to keep things neat
and tidy. Sorry, but there is no perfect solution except a reaper that
goes around killing detached login shells. You should find plenty on
freshmeat.

When the link hangs mgetty (or whatever) isn't around. It'll come
back only when the shell dies. Init is responsible for spotting that
sort of thing and restarting mgetty. Init must get the sigchld (i.e.
it's inevitable, since there are no other parents) when the shell
dies and will restart mgetty then, but the shell may not die. It
may be insensitive to sigpipe, sighup and other signals that downing the
link may have generated.

So really a reaper is the last resort.

:> (whichever that is - it'll probably be your process group session
:> leader).  Is that what you want?  What is the effect you are trying to
:> achieve?  Are you trying to launch a daemon?

: What gave you the idea I was trying to lauch a daemon?

Well, you seemed to be trying to kill the originator of a chain of
processes. That is what a daemon does in order to detach from its
originating shell. It forks once or twice and disinherits itself,
while the original process returns and dies, leaving the child
orphaned but alive.

:> Perhaps a book on unix programming would be helpful?

: Would you recommend the one I have in front of me? - Beginning Linux
: Programming -WROX, or perhaps the one next to it - "Linux Application
: Development"? Or perhaps "Linux Programmer's Reference".  None of them
: seem to say anything about this topic.

Dunno. Never read one. I think looking in Stevens XYZ is about all I do
occasionally, but that's generic unix.

Let's ask again: why do you want their login shell to die when the
line goes down? Is it "accounting"? Look at some of the autologout
daemons. The only other thing I can suggest is that you write the reaper
yourself: every login shell registers its pid and tty and user and you
don't let them run "exec bash" or "exec su ..." - when mgetty comes back
up on a tty, have init first kill the pid that was registered there,
being careful it is owned by the user in question. Oh yes, and what
about uses of "login" once logged in?


Peter

------------------------------

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: So Complicated I Dont Even Know What To Catagorize It As
Date: 10 Sep 2000 06:10:20 GMT

QNA <[EMAIL PROTECTED]> wrote:
: i have windows98 installed in an extended partition along with linux, how 
: do i run windows in recovery mode?

I really think you ought to look in your windows manual!

Please post this question in a windows newsgroup. Alternatively, you
might try hitting random keys at startup. You should get it in 4 or 5
attempts.

Peter

------------------------------

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: Partition Cross-Over Project: Extended to Primary
Date: 10 Sep 2000 06:12:53 GMT

QNA <[EMAIL PROTECTED]> wrote:
: thanks for your help. my computer was extremely jumbled and "messed up" i 
: guess you would say. i downloaded 'Ranish Partition Manager' on a floppy 
: and ran it on my computer then put all of my space on a Primary Dos 
: Partition and deleted everything else then started over with re-installed 

And where is your space now? :-)


Peter

------------------------------

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: Locate inititlization does not complete
Date: 10 Sep 2000 06:18:15 GMT

noyb <[EMAIL PROTECTED]> wrote:
:                    locate -uv
: it hangs up at the file /.automount.

Isn't it "updatedb", and shouldn't you be excluding various
directories?

: It takes a ctl-c to bring back a prompt and of course the database
: is not written, making locate useless.

: I have fsck'ed the drive with -f from a rescue floppy.

: Any idea of what's going wrong?

Not until you show us details of /.automount. It sounds as though
the problem is the NEXT thing that the program looks at, not the
above. But it is suspicious that automount is implicated. Turn off
automount with a -USR2 signal before starting the updatedb. Take
floppy and cdrom offline, etc. Limit updatedb to particular places to
narrow down the problem.

Peter

------------------------------

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: how can I delete blank line?
Date: 10 Sep 2000 06:24:22 GMT

choi jinhyuk <[EMAIL PROTECTED]> wrote:
: I wana delete all blank lines .

Yerrrs .. are you aware that there is nothing to delete in a blank
line?

: succeded in searching like this
: %s/^$//g
: but blank line was not deleted. how can I?

All empty lines were deleted. If you want lines containing only space
characters to be deleted, you shoudl have said so.

: and how can I do it in sed and using grep?

Man sed, man grep.  Is your problem with regular expressions or in the
interpretation of the manpages? It looks like you are using vi, and
sed's syntax is about the same.

Peter

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.misc) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Misc Digest
******************************

Reply via email to