+
+#
+# Reload the server. Used by Main_Process_Signal when $SigName eq "HUP"
+# or when the command "server reload" is received.
+#
+sub ServerReload
+{
+ my($mesg) = @_;
+ $mesg = $bpc->ConfigRead() || $mesg;
+ print(LOG $bpc->timeStamp, "$mesg\n");
+ $Info{ConfigModTime} = $bpc->ConfigMTime();
+ %Conf = $bpc->Conf();
+ umask($Conf{UmaskMode});
+ ServerSocketInit();
+ HostsUpdate(0);
+ $NextWakeup = 0;
+ $Info{ConfigLTime} = time;
+}
+
+#
+# Gracefully shutdown the server. Used by Main_Process_Signal when
+# $SigName ne "" && $SigName ne "HUP" or when the command
+# "server shutdown" is received.
+#
+sub ServerShutdown
+{
+ my($mesg) = @_;
+ print(LOG $bpc->timeStamp, "$mesg\n");
+ if ( keys(%Jobs) ) {
+ foreach my $host ( keys(%Jobs) ) {
+ kill(2, $Jobs{$host}{pid});
+ }
+ sleep(1);
+ foreach my $host ( keys(%Jobs) ) {
+ kill(9, $Jobs{$host}{pid});
+ }
+ %Jobs = ();
+ }
+ StatusWrite();
+ unlink("$TopDir/log/BackupPC.pid");
+ exit(1);
+}
+