Skip to content

Commit

Permalink
[backend] bs_warden: move welcome message after testing the lock
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Oct 4, 2023
1 parent 50ec4d1 commit d94b1dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backend/bs_warden
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ BSUtil::drop_privs_to($BSConfig::bsuser, $BSConfig::bsgroup);
$| = 1;
$SIG{'PIPE'} = 'IGNORE';
BSUtil::restartexit($options, 'warden', "$rundir/$runname");
BSUtil::printlog("starting build service worker warden");

# get lock
mkdir_p($rundir);
open(RUNLOCK, '>>', "$rundir/$runname.lock") || die("$rundir/$runname.lock: $!\n");
flock(RUNLOCK, LOCK_EX | LOCK_NB) || die("worker warden is already running!\n");
utime undef, undef, "$rundir/$runname.lock";

BSUtil::printlog("starting build service worker warden");

my %building;
my $nextorphan = 0;
my $xcheck = 0;
Expand Down

0 comments on commit d94b1dc

Please sign in to comment.