quotes
parent
c6d5198984
commit
6c997a0bd6
|
@ -166,14 +166,14 @@ if ( !$server_up ) {
|
|||
# Server is not up. Some commands can still be handled
|
||||
if ( $command eq 'logrot' ) {
|
||||
# If server is not running, then logrotate doesn't need to do anything.
|
||||
Debug("Server is not running, logrotate doesn't need to do anything");
|
||||
Debug('Server is not running, logrotate doesn\'t need to do anything');
|
||||
exit();
|
||||
}
|
||||
if ( $command eq 'check' ) {
|
||||
print("stopped\n");
|
||||
exit();
|
||||
} elsif ( $command ne 'startup' ) {
|
||||
print("Unable to connect to server using socket at " . SOCK_FILE . "\n");
|
||||
print('Unable to connect to server using socket at ' . SOCK_FILE . "\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ if ( !$server_up ) {
|
|||
my $attempts = 0;
|
||||
while( !connect(CLIENT, $saddr) ) {
|
||||
$attempts++;
|
||||
Debug("Waiting for zmdc.pl server process at ".SOCK_FILE.", attempt $attempts");
|
||||
Debug('Waiting for zmdc.pl server process at '.SOCK_FILE.", attempt $attempts");
|
||||
Fatal("Can't connect: $!") if $attempts > MAX_CONNECT_DELAY;
|
||||
usleep(200000);
|
||||
} # end while
|
||||
|
@ -285,7 +285,7 @@ sub run {
|
|||
dPrint(ZoneMinder::Logger::INFO, 'Socket should be open at ' .main::SOCK_FILE);
|
||||
socket(SERVER, PF_UNIX, SOCK_STREAM, 0) or Fatal("Can't open socket: $!");
|
||||
unlink(main::SOCK_FILE) or Error('Unable to unlink ' . main::SOCK_FILE .". Error message was: $!") if -e main::SOCK_FILE;
|
||||
bind(SERVER, $saddr) or Fatal("Can't bind to " . main::SOCK_FILE . ": $!");
|
||||
bind(SERVER, $saddr) or Fatal('Can\'t bind to ' . main::SOCK_FILE . ": $!");
|
||||
listen(SERVER, SOMAXCONN) or Fatal("Can't listen: $!");
|
||||
|
||||
$SIG{CHLD} = \&chld_sig_handler;
|
||||
|
@ -313,7 +313,7 @@ sub run {
|
|||
|
||||
my @cpuload = CpuLoad();
|
||||
Debug("Updating Server record @cpuload");
|
||||
if ( ! defined $dbh->do(q{UPDATE Servers SET Status=?,CpuLoad=?,TotalMem=?,FreeMem=?,TotalSwap=?,FreeSwap=? WHERE Id=?}, undef,
|
||||
if ( ! defined $dbh->do('UPDATE Servers SET Status=?,CpuLoad=?,TotalMem=?,FreeMem=?,TotalSwap=?,FreeSwap=? WHERE Id=?', undef,
|
||||
'Running', $cpuload[0], &totalmem, &freemem, &totalswap, &freeswap, $Config{ZM_SERVER_ID} ) ) {
|
||||
Error("Failed Updating status of Server record for Id=$Config{ZM_SERVER_ID} :".$dbh->errstr());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue