LinuxQuestions.org
Visit Jeremy's Blog.
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 07-23-2009, 06:07 AM   #1
Akane
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Rep: Reputation: 0
Smile Sh started via cronjob runs ever and uses 100 % CPU


Hi,

i am new to this forum because i got some problems.I hope that somebody can help me here.I always used this method to start my game and login server via a cronjog that starts a sh that starts both.
But after we updated to a newer Server Version of Suse the Sh Process does not stop after the Cronjob has run the Sh.

The code in the Start.sh

Code:
#!/bin/bash

cd /home/Akane/GraciaUpdate/l2j-loginserver/
      . ./rein_start_login.sh
cd /home/Akane/GraciaUpdate/l2jfree-gameserver/
      . ./rein_game_start.sh
I hope that somebody can help me with that because i realy don't know how to fix it.
 
Old 07-23-2009, 07:40 AM   #2
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
Can you explain e little bit more what you mean by sh does not stop?

The way your Start.sh script is written it will not finish until all started program are finished (unless they fork themself). In your case it will first run rein_start_login.sh script. Than wait for it to terminate and run rein_game_start.sh script. And again wait for that to terminate. So check whether this two scripts terminates correctly.
 
Old 07-23-2009, 09:00 AM   #3
Akane
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Sure ok i post the code of the two shs

rein_game_start.sh

Code:
#!/bin/bash
export PATH="/usr/java/jdk1.6.0_10/bin":$PATH
export JAVA_HOME="/usr/java/jdk1.6.0_10/bin"
err=1
until [ $err == 0 ]; 
do
	. ./setenv.sh
screen -A -m -d -S Gracia_Game java -server -Xmx1024m -Xms1024m com.l2jfree.gameserver.GameServer
	err=$?u
#	/etc/init.d/mysql restart
	sleep 10;
done
rein_start_login.sh

Code:
export PATH="/usr/java/jdk1.6.0_10/bin":$PATH
export JAVA_HOME="/usr/java/jdk1.6.0_10/bin"
#!/bin/bash
err=1
until [ $err == 0 ]; 
do
	. ./setenv.sh
screen -A -m -d -S Gracia_Login java -Dfile.encoding=UTF-8 -Xmx64m com.l2jfree.loginserver.L2LoginServer
	err=$?
#	/etc/init.d/mysql restart
	sleep 10;
done


Before it was like that.The start.sh starts the both scripts and then it closes before even the server has loaded so that i can switch to screen and see the server starting.But now the server starts up and the start.sh is still online.Top says me then /usr/bin/sh home/Akane/start.sh with about 90% Cpu.That is our daily server starting script schedulded via cronjob.Hope that are enough information.
 
Old 07-23-2009, 01:15 PM   #4
fbianconi
Member
 
Registered: Apr 2008
Location: argentina
Distribution: Arch
Posts: 86

Rep: Reputation: 22
in rein_game_start.sh
Quote:
err=$?u
there's an u in the line,
if that typo is not the problem, try using "echo $err" before "done" to see if $err can be == 0
 
Old 07-24-2009, 06:11 AM   #5
Akane
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Argh thank you so much i was blind xD.How could i missed that.Thank you.It is working again now.
 
  


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
tar in cronjob does not work 100% jeep88 Linux - Newbie 1 02-19-2009 05:55 AM
CPU runs at 100% when watching videos on YouTube. pollonica Linux - General 2 05-19-2008 10:35 PM
Cron Job only runs when it is manually started sinister1 Linux - General 4 02-25-2008 08:35 AM
LXer: Tiny, sub-$100 PC runs Puppy Linux LXer Syndicated Linux News 0 08-24-2006 04:33 AM
100% cpu use 100% of the time serafean Linux - Newbie 4 05-04-2006 03:36 PM


All times are GMT -5. The time now is 08:27 PM.

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