Help with Terminal

this program I have, KDXServer is unix based and is launched through Terminal. the file is called KDXServer.command. when I double click it, it opens Terminal, leaving the Terminal window open. I went into System Preferences and into Accounts, and for my account I set this KDXServer.command to launch when I login. the problem is, I do not want to see the Terminal window at all. Basically, I want it to launch almost unnoticeablly when I login, with no Terminal window(s) open. I have been told that KDXServer.command must be launched with the arguments "--bkgnd" and "--nohup" but seeing as how I am new to OS X, I do not know how to do this. it would also be nice if the Terminal did not appear in the Dock too. sorry if this is hard to understand, but I hope someone can help.

#232607

that i know of, you can run processes in the background by adding an '&' after the path of the process.

The other thing i know is to create an applescript with "do shell script" and run that.

do shell script "my-command-file-path" &

You will have to wait till the guru, Contra, comes around though... i had never heard of this --bkgnd --nohup

Have you checked http://www.haxial.com/faq/auto-startup/macosx/ ?

EDIT: I found a tutorial http://developer.apple.com/documentation/M...002132/CJBBHDII

#232644

well I figured this all out with the help of Seph. thanks a lot.

#232656

Just in case, I think another way to do it in applescript is to do:

do shell script "/path/to/kdxserver.command > /dev/null 2>&1 &"

Also, if you type it in the terminal, once it's running type ctrl & Z, then type 'bg' (minus quotes) and it'll be running in the background and you can close the terminal.

#232662

ok here is the code I entered in AppleScript

tell application "Terminal"
activate
do script with command "/User/zaba/Documents/KDXServerMacUnix/KDXServer.command --bkgnd --nohup"
end tell
delay 1
tell application "Terminal"
quit
end tell

that will launch terminal, launch KDXServer.command with the --bkgnd and --nohup arguments, delay for one second, then terminate Terminal. Since --nohup was used, KDXServer.command can survive with Terminal being open.

I then saved this code as an application (without startup screen) and went into System Preferences->Accounts->Current User->Startup Items

I added the applescript program I created to the Startup Items, so it now launches when I login.

in the Code area in this post, there are 5 spaces, not tabs. if you copy and paste, don't forget to replace the 5 spaces before the 'activate, etc' things with tabs.

hope I was clear and concise.

#232664

just so you guys know, KDXServer for MacUnix doesn't have a GUI, so the only GUI it did have was Terminal, but since the KDXServer.command was run with the --nohup argument, it can run without a terminal window being open

#232665