From 171840ff503f6c19c228603e190197731426a75b Mon Sep 17 00:00:00 2001 From: Ilia Date: Mon, 13 Jun 2022 11:58:14 +0300 Subject: [PATCH] Fix to check if Webmin/Usermin `systemd` unit was setup https://github.com/webmin/webmin/commit/d357005cba8225e5f06466e273af9585080fd170#comments --- web-lib-funcs.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 74669ddc8..5f8e6a336 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -2401,6 +2401,19 @@ sub reload_miniserv { my ($ignore) = @_; return undef if (&is_readonly_mode()); +if (&has_command('systemctl')) { + &foreign_require("init"); + my $unit_target = + &get_product_name() eq 'usermin' ? + 'usermin' : 'webmin'; + my $unit_path = &init::get_systemd_root($unit_target); + if (-r "$unit_path/$unit_target.service") { + my $rs = &system_logged("systemctl reload $unit_target >/dev/null 2>&1