28 |
{ |
{ |
29 |
my ($startScript) = glob("/etc/rc.d/rc7.d/S*$serviceName") ||'' ; |
my ($startScript) = glob("/etc/rc.d/rc7.d/S*$serviceName") ||'' ; |
30 |
my ($systemdScript) = "/usr/lib/systemd/system/$serviceName.service" ||''; |
my ($systemdScript) = "/usr/lib/systemd/system/$serviceName.service" ||''; |
31 |
@@ -1133,9 +1133,14 @@ |
@@ -1133,9 +1133,15 @@ |
32 |
|
|
33 |
if (-e $systemdScript and ! -e $startScript){ |
if (-e $systemdScript and ! -e $startScript){ |
34 |
# systemd is not aware of adjust, sigusr1, sigusr2, sigterm, sighup |
# systemd is not aware of adjust, sigusr1, sigusr2, sigterm, sighup |
35 |
- $serviceAction = ( $serviceAction =~/^(adjust|graceful|sighup|sigusr1|sigusr2)$/ ) ? "reload" : $serviceAction; |
- $serviceAction = ( $serviceAction =~/^(adjust|graceful|sighup|sigusr1|sigusr2)$/ ) ? "reload" : $serviceAction; |
36 |
- $serviceAction = ( $serviceAction eq "sigterm" ) ? "restart" : $serviceAction; |
- $serviceAction = ( $serviceAction eq "sigterm" ) ? "restart" : $serviceAction; |
37 |
- if ($serviceAction =~/^(start|stop|restart|reload|reload-or-restart|try-restart|try-reload-or-restart|enable -now)$/) { |
- if ($serviceAction =~/^(start|stop|restart|reload|reload-or-restart|try-restart|try-reload-or-restart|enable -now)$/) { |
38 |
+ $serviceAction = ( $serviceAction =~/^(adjust|graceful)$/ ) ? "reload" : $serviceAction; |
+ $serviceAction = ( $serviceAction =~/^(adjust|graceful|sighup|sigusr1|sigusr2)$/ ) ? "reload-or-restart" : $serviceAction; |
39 |
|
+ $serviceAction = ( $serviceAction eq "sigterm" ) ? "restart" : $serviceAction; |
40 |
+ if ($serviceAction =~/^(sig[A-Za-z12]+)$/) { |
+ if ($serviceAction =~/^(sig[A-Za-z12]+)$/) { |
41 |
+ $serviceAction=uc($serviceAction); |
+ $serviceAction=uc($serviceAction); |
42 |
+ system('/usr/bin/systemctl',"kill","--signal=$serviceAction","$serviceName.service") == '0' |
+ system('/usr/bin/systemctl',"kill","--signal=$serviceAction","$serviceName.service") == '0' |