Prevent non-level-0 backups and updating of the /etc/dumpdates file for backups of directories that are not filesystem mount points, as this isn't supported by the <tt>dump</tt> command.
---- Changes since 1.440 ----
Fixed a bug that prevented backups of directories with spaces in their names from working properly on Linux.
+---- Changes since 1.480 ----
+When terminating a running backup, all sub-processes such as tar and dump commands are killed too.
@procs = &proc::list_processes();
@running = &running_dumps(\@procs);
+# Find the job
($job) = grep { $_->{'id'} eq $in{'id'} &&
$_->{'pid'} == $in{'pid'} } @running;
$job || &error($text{'kill_egone'});
&can_edit_dir($job) || &error($text{'kill_ecannot'});
-kill('TERM', $job->{'pid'});
+# Find all sub-processes
+@killprocs = ( $job->{'pid'}, &find_subprocesses($job->{'pid'}) );
+&kill_logged('TERM', @killprocs);
+sleep(1);
+&kill_logged('KILL', @killprocs);
+&webmin_log("kill", undef, $job->{'id'}, $job);
&redirect("");
+sub find_subprocesses
+{
+local ($pid) = @_;
+local @rv;
+foreach my $p (@procs) {
+ if ($p->{'ppid'} && $p->{'ppid'} eq $pid) {
+ push(@rv, $p->{'pid'}, &find_subprocesses($p->{'pid'}));
+ }
+ }
+return @rv;
+}
+
log_backup=Backed up $1 to $2
log_bgbackup=Started backup of $1 to $2
log_restore=Restored backup from $1
+log_kill=Terminated backup for $1
kill_err=Failed to terminate backup
kill_egone=No longer running!
sub parse_webmin_log
{
local ($user, $script, $action, $type, $object, $p) = @_;
-if ($action eq 'create' || $action eq 'modify' || $action eq 'delete') {
+if ($action eq 'create' || $action eq 'modify' ||
+ $action eq 'delete' || $action eq 'kill') {
return &text("log_$action", "<tt>".&html_escape($p->{'dir'})."</tt>");
}
elsif ($action eq 'backup' || $action eq 'bgbackup') {