Put the force-lock-file in the piddir, rather than the globally writeable /tmp
authorGreg Sabino Mullane <greg@endpoint.com>
Sat, 12 Apr 2014 18:25:42 +0000 (14:25 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Sat, 12 Apr 2014 18:25:42 +0000 (14:25 -0400)
Bucardo.pm

index 0430c3ec421f15720f3c7533c4be497a49da837b..e3928f3aca869226a0d0a323027482cc4a4b4eda 100644 (file)
@@ -2988,7 +2988,8 @@ sub start_kid {
 
         ## We may want to lock all the tables. Use sparingly
         my $lock_table_mode = '';
-        my $force_lock_file = "/tmp/bucardo-force-lock-$syncname";
+        my $force_lock_file = File::Spec->catfile( $config{piddir} => "bucardo-force-lock-$syncname" );
+
         ## If the file exists, pull the mode from inside it
         if (-e $force_lock_file) {
             $lock_table_mode = 'EXCLUSIVE';
@@ -3021,7 +3022,7 @@ sub start_kid {
                         $self->glog("Database $dbname: Locking table $com", LOG_TERSE);
                         $x->{dbh}->do("LOCK TABLE $com");
                     }
-                    elsif ('mysql' eq $x->{dbtype} or 'drizzle' eq $x->{dbtype} or 'mariadb' eq $x->{dbtype}) {
+                    elsif ('mysql' eq $x->{dbtype } or 'drizzle' eq $x->{dbtype} or 'mariadb' eq $x->{dbtype}) {
                         my $com = "$tname WRITE";
                         $self->glog("Database $dbname: Locking table $com", LOG_TERSE);
                         $x->{dbh}->do("LOCK TABLE $com");