LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do you bring up terminal in background started with startup script in Gnome? (http://www.linuxquestions.org/questions/linux-newbie-8/how-do-you-bring-up-terminal-in-background-started-with-startup-script-in-gnome-4175430071/)

EODSteven 10-02-2012 10:20 AM

How do you bring up terminal in background started with startup script in Gnome?
 
I can see it running in systems monitor but can't access the terminal program I started with a startup script...Any ideas? For now I took it out of startup and just have the open terminal program so it can be accessed. I did "ask unbuntu" and the only suggestion I got ther was to press the window + s key....Thanks!

Thor_2.0 10-02-2012 11:11 AM

Okay, some thoughts...
At start-up, stuff gets started, but not in a terminal. It runs and the only way to "see" it is either top, or ps. (unless I'm mistaken, in that case: enlighten me)
You can see the breadcrumbs it leaves behind, as logfles.
If you want to see (actually SEE) a program work in a terminal, you have to start it up...in a terminal. You cannot "see" any of that stuff running as such...
Try it! If you've got gimp installed, open a terminal and type

Quote:

gimp
...and see what the program has to say...

So, what is the goal here, anyway. Maybe is we knew where you want to go, we can give you some pointers...

By the way, welcome to the forum...

Thor

DavidMcCann 10-02-2012 11:30 AM

Show us how you started the program in your script and that may reveal what the problem is.

EODSteven 10-02-2012 11:34 AM

More detailed explanation
 
Using the add startup program menu I linked a program called Bukkit Server Script to start a Server program in Terminal at startup. (This is all for my Grandson's Minecraft Game) The Startup program works fine and is running cause he and his freinds can log into the server and play the game. You can also verify that it's running by looking at the systems monitor and see the program but there is no way to access it. Some commands can only be issued from the terminal server. When you load it from the desktop you can minimize it and bring it back to front but when loaded in startup it doesn't show up anywhere. My goal is to have his server load on startup to simplify it for him, but he's got to occasionally access it. I installed GIMP BTW...wow!

Does that help?

EODSteven 10-02-2012 11:37 AM

Script I added to Startup
 
#!/bin/sh
BINDIR=$(dirname "$(readlink -fn "$0")")
cd "$BINDIR"
java -Xmx1024M -Xms1024M -jar craftbukkit.jar

#The Craftbukkit.jar file runs in terminal......

TobiSGD 10-02-2012 11:39 AM

I don't know which terminal Ubuntu uses, but most terminal programs have an execute option, mostly -e or -x. Instead of starting the startup script directly do that using a terminal. For example, i use Roxterm as a terminal, so in the autostart use something like this:
Code:

roxterm -e What_ever_your_startup_script_is_named
Of course you have to adapt the command to the terminal you actually use and to the real script name.

EODSteven 10-02-2012 11:45 AM

Newbie there for a reason :)
 
How do I know what Terminal I use?

TobiSGD 10-02-2012 11:59 AM

I just made a short websearch and it seems that the default terminal emulator on Ubuntu 12.04 is gnome-terminal. So in that case the command would be
Code:

gnome-terminal -e STARTUP_SCRIPT
Replace STARTUP_SCRIPT with the actual name of the script.

EODSteven 10-02-2012 12:18 PM

Ok...
 
It's running as a gnome-session terminal but I still can't access it.

EODSteven 10-02-2012 12:25 PM

Screen shot of how it's loaded
 
1 Attachment(s)
Here's the screen shot of how it's loaded in startup.

Nevermind...Just tried to load his game and it won't work like this with the gnome terminal prefix added to startup command....

EODSteven 10-02-2012 12:34 PM

Screen shot of system monitor
 
1 Attachment(s)
Ok, I put it back to running the script and it's fine, here's a pic of system monitor showing the craftbukkit.sh file

I bet I have to provide the path to the terminal then back to the script again......whew.....what a mess!

unSpawn 10-02-2012 12:41 PM

Have your startup script run screen:
Code:

#!/bin/sh --
screen -S minecraft -d -m /path/to/craftbukkit.sh
exit 0

screen then starts the craftbukkit script and detaches the session which you can later on list with 'screen -ls' and enter with 'screen -dr' from any console or terminal window.

EODSteven 10-02-2012 12:48 PM

Thank you!
 
Added the gnome-terminal -e before file and the path and it ran fine! The first time I included it after the path to the script file and thats why it didn't work.

Very Nice...Next time he's over he'll be excited!

EODSteven 10-02-2012 12:56 PM

This is what I need but I'm confused....
 
Quote:

Originally Posted by unSpawn (Post 4795175)
Have your startup script run screen:
Code:

#!/bin/sh --
screen -S minecraft -d -m /path/to/craftbukkit.sh
exit 0

screen then starts the craftbukkit script and detaches the session which you can later on list with 'screen -ls' and enter with 'screen -dr' from any console or terminal window.

Gonna try this too but what is the minecraft -d in there...Sorry don't understand this. :(

unSpawn 10-02-2012 01:01 PM

See 'man screen'. If it says no such manual page and such you need to install the "screen" package first.


All times are GMT -5. The time now is 10:31 AM.