Start of work on atd server support

This commit is contained in:
Jamie Cameron
2020-09-26 19:22:07 -07:00
parent 38fc075167
commit 63e4afbce6
3 changed files with 39 additions and 0 deletions

View File

@ -137,5 +137,29 @@ if ($access{'allow'} && $config{'allow_file'}) {
print &ui_form_end([ [ "save", $text{'save'} ] ]);
}
# If there is an init script that runs an atd server, show status
&foreign_require("init");
my $init = defined(&get_init_name) ? &get_init_name() : undef;
if ($init) {
print &ui_hr();
print &ui_buttons_start();
# Running now?
my $r = &init::status_action($init);
if ($r == 1) {
print &ui_buttons_row("stop.cgi", $text{'index_stop'},
$text{'index_stopdesc'});
}
elsif ($r == 0) {
print &ui_buttons_row("start.cgi", $text{'index_start'},
$text{'index_startdesc'});
}
# Start at boot?
# XXX
print &ui_buttons_end();
}
&ui_print_footer("/", $text{'index'});

View File

@ -20,6 +20,10 @@ index_amode2=All except listed users ..
index_delete=Cancel Selected Commands
index_noat=The $1 command was not found on your system - maybe it is not installed, or not available for your operating system.
index_nostyle=Webmin does not know how to manage schedule commands on this operating system.
index_stop=Stop Scheduled Commands Server
index_stopdesc=Shut down the <tt>atd</tt> background server process that runs scheduled commands. This will prevent commands from executing at their specified times.
index_start=Start Scheduled Commands Server
index_startdesc=Start up the <tt>atd</tt> background server process that runs scheduled commands. This is required for commands to execute at their specified times.
edit_title=Scheduled Command
edit_cmd=Full script to execute

View File

@ -59,3 +59,14 @@ sub delete_atjob
&system_logged("atrm ".quotemeta($_[0])." >/dev/null 2>&1");
}
# get_init_name()
# Returns the name of the bootup action for atd, if there is one
sub get_init_name
{
&foreign_require("init");
if (&init::action_status("atd") != 0) {
return "atd";
}
return undef;
}