Questions and Answers :
Unix/Linux :
Make app run in background?
Message board moderation
Author | Message |
---|---|
Chris Wilcox Send message Joined: 3 Apr 99 Posts: 1 Credit: 525 RAC: 0 ![]() |
Hi, Is there anyway I can start the app so it runs in the background? I have an annoying habit of closing terminals without thinking what apps are running in them! Regards, Chris |
Darren ![]() Send message Joined: 2 Jul 99 Posts: 259 Credit: 280,503 RAC: 0 ![]() |
I assume you're talking about a terminal you've opened within a gui. I do the same thing occassionally. I'm sure there are many better ways to get around this, but I just change to an available tty (alt-ctrl-F#) and start the client there, that way whatever I do in the gui (even logging out) doesn't stop boinc. Pick any F# except F7 - that's where your gui runs - then just alt-ctrl-F7 to get back to your gui after you've started the client elsewhere. |
Merlin Send message Joined: 24 Nov 99 Posts: 18 Credit: 4,168,479 RAC: 1 ![]() |
You can run an application (such as boinc) in background like this: Open an terminal and type ./boinc_xxx > logfile.txt 2>&1 & This starts boinc in background and redirects output to a logfile (logfile.txt). You can now exit this terminal with CTRL + D |
Mark Bauer Send message Joined: 3 Apr 99 Posts: 3 Credit: 1,748,491 RAC: 0 ![]() |
You might also try the screen command. It works well for me. mark |
jkmobrien Send message Joined: 8 Dec 00 Posts: 7 Credit: 260,674 RAC: 0 ![]() |
When you start it, you can use nohup and the background operator... nohup boinc_xxx & That way closing the window, or logging out, won't kill the process. John |
![]() Send message Joined: 18 Jun 99 Posts: 221 Credit: 122,319 RAC: 0 ![]() |
You should be able to run this as a cron job, e.g., $ crontab -e 0 1,5,9,13,17,21 * * * cd /home/trane/boinc/ ; ./boinc_3.18_i686-pc-linux-gnu > /dev/null 2> /dev/null Save your job with :wq to exit the editor. Basically, this is the same method used to run the classic seti@home. You can look at the slot's state.sah task to monitor progress. An instance should give you a load of 1.0 for each CPU running. trane |
S@NL - rob Send message Joined: 2 Oct 99 Posts: 10 Credit: 124,589 RAC: 0 ![]() |
i found on this page 2 ways to run it on the bachground. http://predictor.scripps.edu/client.php#cmdline i found these 2 ways How can I install my BOINC client as a background process which always runs even if I log out of my PC and How can I install my BOINC client so that it is automatically started when I boot my PC rob |
![]() Send message Joined: 29 Oct 00 Posts: 5 Credit: 194,630 RAC: 0 ![]() |
start boinc hide on console 9 #! /bin/sh cd /home/boinc nice -1 /home/boinc/boinc &>/dev/tty9 & start boinc foreground with option to upgrade #! /bin/sh if [ $1 ]; then cd /home/boinc nice -1 /home/boinc/boinc -update_prefs http://setiathome.berkeley.edu else nice -1 /home/boinc/boinc fi stop boinc #! /bin/sh pid=$(ps -aux |grep boinc |grep -v grep |awk '{print $2}') eval kill $pid the boincclient must named boinc SuSE Linux you can open the startscript in the boot.local |
not in use Send message Joined: 22 Jun 01 Posts: 32 Credit: 1,554 RAC: 0 ![]() |
If you are using KDE as a desktop. I think the best way with my setup was. 1. Write a simple script #!/bin/sh cd /home/user/bin/boinc exec /home/user/bin/boinc/boinc_3.20_i686-pc-linux-gnu 2. Creat a short cut in to the script /home/user/.kde/Autostart Whare user is replace with correct name. And with point one chage the directory name after cd and exec. I did not want projects running as root. You should have one instance of Boinc running every time you loggin. |
![]() Send message Joined: 15 Jul 04 Posts: 3 Credit: 19,749 RAC: 0 ![]() |
I think screen is the best way to push a app to the background. If you use the a console you won't have acces through a remote connection to the appa output. Screen also doesn't care if your're logged in or not. Everytime you come back you can pop the app back with screen -r. The screens made by screen are interactive so it's possible to interact with the app. -[may the force be with you]=- |
Jaguar Send message Joined: 4 Jan 04 Posts: 1 Credit: 1,171,537 RAC: 0 ![]() |
As jkmobrien stated you can use nohup, works great. I use the following: nohup ./boinc_xxxxxx > log.txt & |
![]() Send message Joined: 12 Sep 99 Posts: 4 Credit: 41,648 RAC: 0 ![]() |
The way I use to run BOINC as a background task on a Linux machine automatically at startup : 1) a small shell script is used to prepare running the programm as a background task ; 2) The /etc/inittab file is modified by adding a line which is calling the shell script at startup and is creating a new virtual console that displays SETI@home working. An exemple : here, boinc (boinc_4.09_i686-pc-linux-gnu) is located in the /home/godetj/files/SETI directory. In the same directory is located the small shell script "startboinc". Content of the startboinc executable file : ------------------------------------------------------------------ #!/bin/sh cd /home/godetj/files/SETI rm -f ./lockfile exec ./boinc_4.09_i686-pc-linux-gnu < $1 > $1 2>&1 ------------------------------------------------------------------ and a 7th virtual concole is added to the /etc/inittab like that : Part of the inittab file showing the new line added : ------------------------------------------------------------------ # These are the standard console login getties in multiuser mode: c1:1235:respawn:/sbin/agetty 38400 tty1 linux c2:1235:respawn:/sbin/agetty 38400 tty2 linux c3:1235:respawn:/sbin/agetty 38400 tty3 linux c4:1235:respawn:/sbin/agetty 38400 tty4 linux c5:1235:respawn:/sbin/agetty 38400 tty5 linux c6:12345:respawn:/sbin/agetty 38400 tty6 linux c7:12345:respawn:/home/godetj/files/SETI/startboinc /dev/tty7 ------------------------------------------------------------------ Best regards ! -- Jean-Pierre - Powered by Linux (Slackware 10.0 - kernel 2.4.26) |
Joseph Send message Joined: 28 Mar 02 Posts: 1 Credit: 2,646,679 RAC: 1 ![]() |
Here's the simplest solution: [josephp@localhost seti]$./boinc_4.09_i686-pc-linux-gnu & Seti will display some text, blah blah, press return, now you're at a prompt. Logout. When you log back in, do a ps -ax and you'll see Boinc and Seti running. It runs in the background. No need for no complicated scripts ;-) Of course, I am sure I am doing something wrong, hogging something, BUT, I use my linux box for SMB file sharing, print sharing and SETI -- so it's all good. Good luck! cablemodemjoey |
©2025 University of California
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.