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 - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-22-2011, 05:11 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
How to write a script to get off the console after calling /run.sh?


Hi,



When I start the Jboss using the Jboss script run.sh, the console can not be used anymore and you have to stop it by opening another console. So I am going to write a script which calls up the run.sh and then get off the console so that this console can be used.



My script looks as follow:



Code:
#!/bin/bash

 

$JBOSS_HOME/bin/run.sh

 

exit


But it doesn't get off. I am sure it's missing some code. Someone cann help?



Regards



Thomas
 
Old 03-22-2011, 05:23 AM   #2
rgdacosta
Member
 
Registered: Jun 2007
Location: South Africa
Distribution: Linux Mint,Fedora, openSUSE, RHEL, SLES, Scientific Linux
Posts: 71

Rep: Reputation: 25
Add an & after your command
 
Old 03-22-2011, 05:39 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Or you can start it like this
Code:
/path/to/jboss/bin/run.sh & 2>&1> /dev/null
Cheers
 
1 members found this post helpful.
Old 03-22-2011, 05:41 AM   #4
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by rgdacosta View Post
Add an & after your command
It doesn't work.
 
Old 03-22-2011, 07:31 AM   #5
timdvtemp
Member
 
Registered: Feb 2011
Distribution: Redhat/Fedora
Posts: 39

Rep: Reputation: 3
Quote:
#!/bin/bash



$JBOSS_HOME/bin/run.sh



exit
try typing the full path when you include the ampersand:

Code:
#!/bin/bash

/home/jboss/bin/run.sh & 

exit
 
Old 03-22-2011, 07:36 AM   #6
timdvtemp
Member
 
Registered: Feb 2011
Distribution: Redhat/Fedora
Posts: 39

Rep: Reputation: 3
on second thought, what is your output when you type "run.sh &", without having to use that second script?? (Assuming that it has been made an executable)?

Last edited by timdvtemp; 03-22-2011 at 07:39 AM.
 
Old 03-22-2011, 08:40 AM   #7
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by bathory View Post
Or you can start it like this
Code:
/path/to/jboss/bin/run.sh & 2>&1> /dev/null
Cheers
Your solution is near what I want.

I did as follow:

Code:
$JBOSS_HOME/bin/run.sh -b $JBOSS_HOST -c $JBOSS_USER > /dev/null &
And it works fine.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
need to write a run level 3 script knockout_artist Linux - Newbie 5 11-12-2008 11:45 AM
Getting a script to run X app through console Harlin Linux - Software 1 07-06-2007 10:38 AM
Write a script to run several commands ??? wahaha Linux - Software 1 04-13-2007 08:20 PM
calling another script to be run. sonesay Programming 2 05-23-2004 06:08 AM
Can't write to /var/run/console cpeppler Linux - General 2 10-03-2003 07:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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