LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-06-2012, 09:00 AM   #1
Auzern
Member
 
Registered: Jul 2010
Posts: 44

Rep: Reputation: 0
Exclamation ./Kaillera script


Greetings.

I have a newbie question.
I am running a server by executing a command "./kaillera" in Terminal.
The problem is, if I close my terminal, it closes the server program "Kaillera".

How do I execute it as a process so that it runs in the background itself AND every time automatically when the system is switched on?

Again, the file is just called "./kaillera" and there is no make or install valid for it.

BTW, I'm running Centos 5. So any help would be greatly appreciated.

Last edited by Auzern; 05-06-2012 at 10:20 AM.
 
Old 05-06-2012, 11:02 AM   #2
Babertje
Member
 
Registered: Jun 2009
Location: Haarlem, The Netherlands
Distribution: Archlinux
Posts: 125

Rep: Reputation: 20
Code:
./kaillera &
Note the & after the command
 
Old 05-06-2012, 11:19 AM   #3
Auzern
Member
 
Registered: Jul 2010
Posts: 44

Original Poster
Rep: Reputation: 0
Yes, I tried that and it did not work

After I close my SSH, even Kaillera closes.

Last edited by Auzern; 05-06-2012 at 11:43 AM.
 
Old 05-06-2012, 12:03 PM   #4
Babertje
Member
 
Registered: Jun 2009
Location: Haarlem, The Netherlands
Distribution: Archlinux
Posts: 125

Rep: Reputation: 20
Ok, create a shellscript like this
Code:
#!/bin/bash
/this/real/path/to/kaillera &
replace the real path, this way make a new shell and you can exit your shh connection
 
1 members found this post helpful.
Old 05-06-2012, 12:16 PM   #5
Auzern
Member
 
Registered: Jul 2010
Posts: 44

Original Poster
Rep: Reputation: 0
Thanks a lot.
That fixed the problem. But I had to write this:-
Code:
#!/bin/bash
/root/kailleraserv-0.86/
./kaillera &
I saved it as kaillera.sh and executed it with the sh command.

Now is there anyway activate this automatically when it boots up?
 
Old 05-06-2012, 12:46 PM   #6
Babertje
Member
 
Registered: Jun 2009
Location: Haarlem, The Netherlands
Distribution: Archlinux
Posts: 125

Rep: Reputation: 20
add

Code:
/root/kailleraserv-0.86/kaillera &
to your /etc/rc.local then it starts as the very last thing after all your normal init scripts

easiest way to add that is by typing
Code:
echo "/root/kailleraserv-0.86/kaillera &" >> /etc/rc.local

Last edited by Babertje; 05-06-2012 at 12:48 PM.
 
Old 05-06-2012, 12:49 PM   #7
Auzern
Member
 
Registered: Jul 2010
Posts: 44

Original Poster
Rep: Reputation: 0
I doubt that would work since I tried it earlier.
Remember, I had to type "./kaillera &" to run the server?
So is it possible to add "sh /root/kailleraserv-0.86/kaillera.sh" ?
 
Old 05-06-2012, 07:21 PM   #8
Babertje
Member
 
Registered: Jun 2009
Location: Haarlem, The Netherlands
Distribution: Archlinux
Posts: 125

Rep: Reputation: 20
yes just call your shell script that contains the "./kaillera $" command and if it's chmodded to execute no need to put sh in front.
 
  


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
[SOLVED] bash and xterm: how make apps started by and for a script persist when script terminates porphyry5 Linux - General 4 06-15-2011 02:27 PM
[SOLVED] Script question: create a shell script in kde to log in on a server with ssh c4719929 Linux - Newbie 1 01-31-2011 04:05 AM
Need help with script to organise files into folders as part of DVD backup script jasybee2000 Linux - Newbie 5 06-15-2009 08:29 PM
How to get full path to script file inside script itself? And in case of sym links? maggus Linux - Newbie 3 05-28-2009 09:40 AM
wine and kaillera Skeletonkey Linux - Software 0 10-01-2003 01:42 AM

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

All times are GMT -5. The time now is 03:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration