LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-25-2006, 06:54 AM   #1
js_valencia
LQ Newbie
 
Registered: Nov 2005
Posts: 19

Rep: Reputation: Disabled
Small problem with shell scripts


Hi guys,

After some play around, I've managed to write my own shell script which will start and stop some processes through a menu.

Users logon through putty to a remote server and they get presented a menu in which they can chose between a few options.

One of them is to start a postgreSQL server.
They also got the option to stop this server.

Now when I fire up this server through this menu it goes well. Untill they close putty.
This means all the processes being run by that user get terminated.

The funny thing is, as soon as I press the quit option in the menu, the menu ends and brings you back to the prompt.
If users close putty after that, the server keeps running without any problem.

Now you all have guessed, I'm trying to find a way to execute a different script when pressing the quit option.
One that will log the users off from the shell, leaving the processes running they have.

Hope someone can help me out as I'm starting to pull my hears of my head.

Kind regards and thank you for reading.

Jorge Valencia
 
Old 02-25-2006, 07:21 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
"man nohup" may help you.
 
Old 02-25-2006, 07:33 AM   #3
js_valencia
LQ Newbie
 
Registered: Nov 2005
Posts: 19

Original Poster
Rep: Reputation: Disabled
Cool, this partially helped. thanks.

Now I've come accross a different thing.

It partially works because it still kills the process, but the sleep option makes it come up again after 60 seconds. which is good.

If it would be possible I need it to not kill the process at all, since it needs to run without being killed when closing putty.

What I'm wondering
Isn't there a way that when someone presses the quit option in the menu it will shut down the menu itself and then log off from the shell?

This would save me a lot more trouble.

Anyway... thank you very much for the option you've given me before, that has helped in some way, but as you can read, it isn't the entire sollution

Thanks again.

Kind regards

Jorge Valencia
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FileServer w/ automated scripts for a small-sized enterprise tyiooo Linux - Enterprise 3 08-27-2005 12:26 PM
shell scripts rocketgo Linux - General 10 12-01-2003 05:20 AM
Shell Scripts benwy Linux - Software 1 06-09-2003 02:58 AM
shell scripts... roofy Linux - Newbie 13 05-06-2003 06:06 PM
need help on shell scripts!!! krcool32 Programming 5 04-28-2003 03:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration