* Conditionally rely on Gtk2 perl module -- no marginal UI without it,
but you can also install the MSVA now without needing to pull in a
bunch of Gtk libs (closes MS #2514)
+ * Sending a SIGHUP to the running server now re-execs it cleanly,
+ keeping the same port assignments and monitoring the same child
+ process. This can be used to upgrade running msva instances after a
+ package update (closes MS #2532)
-- Daniel Kahn Gillmor <dkg@fifthhorseman.net> Mon, 11 Oct 2010 16:02:22 -0400
}
$self->port($port);
- my $argcount = @ARGV;
- if ($argcount) {
+ if ((exists $ENV{MSVA_CHILD_PID}) && ($ENV{MSVA_CHILD_PID} ne '')) {
+ # this is most likely a re-exec.
+ msvalog('info', "This appears to be a re-exec, monitoring child pid %d\n", $ENV{MSVA_CHILD_PID});
+ $self->{child_pid} = $ENV{MSVA_CHILD_PID} + 0;
+ } elsif ($#ARGV >= 0) {
$self->{child_pid} = 0; # indicate that we are planning to fork.
my $fork = fork();
if (! defined $fork) {
if ($fork) {
msvalog('debug', "Child process has PID %d\n", $fork);
$self->{child_pid} = $fork;
+ $ENV{MSVA_CHILD_PID} = $fork;
} else {
msvalog('verbose', "PID %d executing: \n", $$);
for my $arg (@ARGV) {