From b92d8d11d66c5547232298d5ce9a2ab52661c35c Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 27 Apr 2025 09:52:43 -0700 Subject: [PATCH] Make sure atd is running if needed https://github.com/webmin/webmin/issues/2461 --- updown/download.cgi | 9 +++++++++ updown/lang/en | 1 + 2 files changed, 10 insertions(+) diff --git a/updown/download.cgi b/updown/download.cgi index 781b0d628..b48e2d26f 100755 --- a/updown/download.cgi +++ b/updown/download.cgi @@ -72,6 +72,15 @@ if ($in{'bg'} == 1 && $can_schedule) { eval { $download{'time'} = timelocal(0, $in{'min'}, $in{'hour'}, $in{'day'}, $in{'month'}, $in{'year'}-1900) }; $@ && &error($text{'download_edate2'}); + + # Validate that atd is running, if needed + if (&foreign_installed("at") && !$module_info{'usermin'}) { + &foreign_require("at"); + my ($init, $r, $atboot) = &at::get_init_status(); + if ($init && $r == 0) { + &error(&text('download_eatd', &get_webprefix().'/at/')); + } + } } if (defined($in{'email_def'}) && !$in{'email_def'}) { # Validate email diff --git a/updown/lang/en b/updown/lang/en index 6983110d3..6145b4990 100644 --- a/updown/lang/en +++ b/updown/lang/en @@ -78,6 +78,7 @@ download_failed=Download failed : $1 download_eaccess=You are not allowed to download files to $1 download_eucannot=You are not allowed to download files as user $1 download_egcannot=The selected group does not contain the selected user +download_eatd=Scheduled downloads are not possible unless the At daemon is running. It can be started in the scheduled commands module. cancel_err=Failed to cancel downloads cancel_enone=None selected