LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2011, 10:45 AM   #1
diamond_D
Member
 
Registered: Jul 2005
Posts: 51

Rep: Reputation: 0
Alias to run a program in the background


I have a n00b question.

I'm running Utorrent server and I figure I would create an alias to launch the program and run it in the background.

alias utorrent='/home/user1/software/utorrent-server-3.0/utserver &'

It seems to run the program but the associated webui program is flaky and won't start correctly.

If I manually go to the specified path and run the command ./utserver & , I never seem to have an issue with the webui.
I was wondering if this could possibly have anything to do with using the '&' ampersand operator in an alias.
 
Old 03-04-2011, 11:04 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
Originally Posted by diamond_D View Post
I have a n00b question.

I'm running Utorrent server and I figure I would create an alias to launch the program and run it in the background.

alias utorrent='/home/user1/software/utorrent-server-3.0/utserver &'

It seems to run the program but the associated webui program is flaky and won't start correctly.

If I manually go to the specified path and run the command ./utserver & , I never seem to have an issue with the webui.
I was wondering if this could possibly have anything to do with using the '&' ampersand operator in an alias.
To make an alias that might work:

Code:
alias utorrent="cd /home/user1/software/utorrent-server-3.0/; ./utserver &"
or a function in .bashrc:

Code:
function utserver () { 
cd /home/user1/software/utorrent-server-3.0/;
./utserver & }
 
Old 03-05-2011, 11:47 AM   #3
diamond_D
Member
 
Registered: Jul 2005
Posts: 51

Original Poster
Rep: Reputation: 0
Code:
alias utorrent="cd /home/user1/software/utorrent-server-3.0/; ./utserver &"
Your alias above works but I'm trying to understand the logic. My original alias had the full path to the program so shouldn't I be able to execute 'utserver' without using the . dot operator. Then I figured I would export the full path to my .bashrc and login again to see if that made any difference but it didn't.

The only way I can get the webui to work properly is if I launch the program using the ./ dot operator from the local directory. If anybody can help explain why, I would much appreciate.
 
Old 05-04-2012, 06:04 PM   #4
avangel
LQ Newbie
 
Registered: Dec 2010
Distribution: Arch
Posts: 9

Rep: Reputation: 1
nohup

I was looking for something similar, e.g. start eclipse from a specific path.
I found a nice tutorial regarding nohup at http://www.quantprinciple.com/invest...ix/jobcontrol/ .
I think that's the correct way to do it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run program in background karabaja4 Linux - Newbie 3 01-05-2008 01:57 PM
postfix: run redirected alias mail through spamd DaveQB Linux - Server 2 03-05-2007 01:19 AM
how to run any binary in background - background process tej Linux - Newbie 1 08-16-2004 01:27 AM
Run a program in the background??? KaptinKABOOM Linux - Software 5 07-06-2004 07:40 AM
alias or function in .bashrc, which sends command to background ngomong Linux - General 1 04-23-2002 10:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:40 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