Skip to content

Commit

Permalink
Multiple services can get started for Accept=true.
Browse files Browse the repository at this point in the history
  • Loading branch information
adelton committed Sep 26, 2015
1 parent e8ef4a0 commit cbc290f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions systemctl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ sub log_command {
}
log_command("[@ARGV]\n");
shift if @ARGV and $ARGV[0] eq '-q';
my $mark_active = 1;
if (@ARGV and $ARGV[0] eq '--no-activate') {
$mark_active = 0;
shift;
}

for (my $i = 0; $i < @ARGV; $i++) {
if ($ARGV[$i] eq '--ignore-dependencies') {
Expand Down Expand Up @@ -494,7 +499,7 @@ if ($COMMAND eq 'start') {
$ENV{_SYSTEMCTL_LITE_STARTING} = $FULL_SERVICE;
}

if ($TYPE eq 'service' and is_running($data)) {
if ($TYPE eq 'service' and $mark_active and is_running($data)) {
log_command("Service [$FULL_SERVICE] already found running, not starting again.\n");
exit;
}
Expand Down Expand Up @@ -654,7 +659,7 @@ if ($COMMAND eq 'start') {
log_command("Starting [$FULL_SERVICE] created PIDFile [$data->{'Service.PIDFile'}] but the process is not running\n");
exit 11;
}
} else {
} elsif ($mark_active) {
local * PIDFILE;
open PIDFILE, '>', "$RUNNING_DIR/$FULL_SERVICE.pid";
print PIDFILE "$pid\n";
Expand Down
2 changes: 1 addition & 1 deletion systemctl-socket-daemon
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ while (1) {
open(STDIN, "<&", $connection);
close STDOUT;
open(STDOUT, ">&", $connection);
exec '/bin/systemctl', 'start', $service;
exec '/bin/systemctl', '--no-activate', 'start', $service;
die "exec should have never reached here\n";
}
}
Expand Down

0 comments on commit cbc290f

Please sign in to comment.