• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Linux Uptime shows 0h 0m :f

Hermes

dziwki kola gramy w lola
Joined
Nov 17, 2007
Messages
1,867
Reaction score
14
Location
Poland
Hi.

I have a small problem :C. Recently I've made a complete reinstall of the system on my dedicated server (debian lenny). I noticed that my uptime indicator shows 0h 0m all the time, but sometimes (one refresh of about 20) it's displayed correctly. I think it has something to do with file rights~.

I am using Gesior AAC as a base (rewritten somehow, but uptime always worked :f).

Any ideas, someone?

Thanks in advance,
Hermes
 
It seems that the script that worked well before is saving config in a wrong way, without line breaking:
Code:
serverStatus_checkInterval = "303"serverStatus_lastCheck = "1296944159"serverStatus_online = "1"serverStatus_players = "4"serverStatus_uptime = "0h 0m"serverStatus_monsters = "8432"
And it keeps uptime set to 0h 0m (but sometimes it actually sets uptime correctly for one second and then it goes back to 0h 0m). :C
 
It was already 777 :C, but I am wondering why it's not using line breaks. And in lighttpd error log it shows that there's an error in syntax in serverstatus (lack of line breaks).
 
Try to edit config-and-functions.lua and add an \n, in this part:
Code:
	foreach($config['status'] as $param => $data)
	{
$file_data .= $param.' = "'.str_replace('"', '', $data).'"
[B][COLOR="red"]';[/COLOR][/B]
	}
 
Code:
foreach($config['status'] as $param => $data) {
	$file_data .= $param.' = "'.str_replace('"', '', $data).'"\n';
}
output:
Code:
serverStatus_checkInterval = "303"\nserverStatus_lastCheck = "1297022055"\nserverStatus_online = "1"\nserverStatus_players = ""\nserverStatus_playersMax = ""\nserverStatus_uptime = "0h 0m"\nserverStatus_monsters = ""\n
lmao : D (same with the php function for newline)
 
look if work or post your layout.php
PHP:
Uptime: <?PHP if($config['status']['serverStatus_online'] == 1) echo $config['status']['serverStatus_uptime'].''; else echo '0h 0m'; ?><br />
									Players Online: <?PHP if($config['status']['serverStatus_online'] == 1) echo $config['status']['serverStatus_players'].''; else echo '0'; ?><br />

rep++
 
Back
Top