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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-29-2006, 11:58 PM
|
#1
|
|
Member
Registered: Aug 2006
Distribution: slack
Posts: 323
Rep:
|
program running after logout?
howto to run program after logging out??
|
|
|
|
09-30-2006, 12:41 AM
|
#2
|
|
Member
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222
Rep:
|
Check out man nohup
|
|
|
|
09-30-2006, 01:11 AM
|
#3
|
|
Member
Registered: Aug 2006
Distribution: slack
Posts: 323
Original Poster
Rep:
|
this works...
nohup wget ftp://nohup.org/howto.iso & >> nohup.out
|
|
|
|
09-30-2006, 01:18 AM
|
#4
|
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,466
Rep: 
|
You don't need to use nohup for wget, it'll keep running when you logout AFAIK.
|
|
|
|
09-30-2006, 09:01 AM
|
#5
|
|
Guru
Registered: Jan 2001
Posts: 24,128
Rep: 
|
Or just use the mighty screen.
man screen
Better and more powerful in my opinion.
|
|
|
|
10-04-2006, 06:25 AM
|
#6
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,516
Rep: 
|
Possibly a stupid question, but ...
When he wants to run something after logging out, that process won't need interactive input. So why not use "command &" and have done?
Where is my error?
|
|
|
|
10-04-2006, 09:54 AM
|
#7
|
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,466
Rep: 
|
Logging out will kill that process, I think.
|
|
|
|
10-05-2006, 01:20 AM
|
#8
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,516
Rep: 
|
Why should it? Test:
- start a(ny) process in the background
- note the PID
- logout
- log in as root and have a look at the PID of your process
I just can't do it myself, I'm sitting in front of a windows box...
|
|
|
|
10-06-2006, 10:51 PM
|
#9
|
|
Member
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222
Rep:
|
Quote:
|
Originally Posted by JZL240I-U
Why should it?
|
As a rule of thumb child processes are terminated when their parent process ends.
|
|
|
|
10-07-2006, 02:10 PM
|
#10
|
|
Guru
Registered: Jan 2001
Posts: 24,128
Rep: 
|
Quote:
|
Originally Posted by SlackDaemon
As a rule of thumb child processes are terminated when their parent process ends.
|
And to follow up with better detail, running a command with & at the end is just forking off the /bin/bash shell process when logged in, this is why it dies if you logout. Use screen or the nohup if you desire to logout before the command finishes.
|
|
|
|
10-09-2006, 01:34 AM
|
#11
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,516
Rep: 
|
Aha, thanks, learnt something new  .
|
|
|
|
10-09-2006, 09:22 PM
|
#12
|
|
Member
Registered: Jul 2003
Location: NY
Distribution: None (src & compile)
Posts: 249
Rep:
|
Many shells have a "logout" script the runs after you logout. I use these to usually clear the display.
Tcsh and Csh have /etc/csh.logout.
Zsh has /etc/zlogout
I don't know about bash/ash, and I deny the existance of ksh since it doesn't have a nice prompt.
You can also use the "at" daemon to do stuff for you whenever. I've even upgraded an Openssh server , including restart, while logged in by that Openssh server.
Ex:
# at now + 2 minutes
at>(do something)
at>(do something else)
#
# logout
2 minutes later...(stuff)
I think also the "disown" command will let you logout while the process stays in the background (for Zsh).
|
|
|
|
10-10-2006, 01:23 AM
|
#13
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,516
Rep: 
|
Interesting. Learnt again.  Carry on anyone?
BTW, bash knows the "disown" too.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:03 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|