Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/zmpkg.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ if ( !$command || $command !~ /^(?:start|stop|restart|status|logrot)$/ )
if ( $command )
{
# Check to see if it's a valid run state
my $sql = "select * from States where Name = '$command'";
my $sql = 'select * from States where Name = ?';
my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );
my $res = $sth->execute() or Fatal( "Can't execute: ".$sth->errstr() );
my $res = $sth->execute( $command ) or Fatal( "Can't execute: ".$sth->errstr() );
if ( $state = $sth->fetchrow_hashref() )
{
$state->{Name} = $command;
Expand Down Expand Up @@ -138,7 +138,7 @@ if ( $command =~ /^(?:stop|restart)$/ )
}
}

runCommand( "zmupdate.pl -f" );
#runCommand( "zmupdate.pl -f" );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this commented out?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zmupdate -f simply reads info from the dB and turns around and writes it right back to the dB. It looks like user Stan added this back in 2011, but I don't know what his intent was. This same command was also part of the stock zm init script, but after discussing it with mastertheknife I commented it out (the one in the init file).

TLDR: This might be the cause of the Conig table corruption issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is, if you are going to modify the Config Table, you have to exclusively lock it so that nothing reads in the meantime.


if ( $command =~ /^(?:start|restart)$/ )
{
Expand Down