/[smeserver]/rpms/e-smith-lib/sme10/e-smith-lib-2.6.0-bz11177-signals.patch
ViewVC logotype

Diff of /rpms/e-smith-lib/sme10/e-smith-lib-2.6.0-bz11177-signals.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.1 by jpp, Fri Jan 1 23:22:03 2021 UTC Revision 1.3 by jpp, Sat Jan 2 06:45:26 2021 UTC
# Line 12  diff -Nur e-smith-lib-2.6.0.old/root/etc Line 12  diff -Nur e-smith-lib-2.6.0.old/root/etc
12  +        # bring the service up if it is enabled (and we're not stopping it or running it once, or using signal able to start it)  +        # bring the service up if it is enabled (and we're not stopping it or running it once, or using signal able to start it)
13  +        unshift(@actions,'start') if ($enabled && !grep { /^(down|stop|d|once|o|start|restart|reload-or-restart)$/ } @actions) ;  +        unshift(@actions,'start') if ($enabled && !grep { /^(down|stop|d|once|o|start|restart|reload-or-restart)$/ } @actions) ;
14  +       # stop the service if it is disabled  +       # stop the service if it is disabled
15  +       @actions = ('stop');  +       @actions = ('stop') unless  $enabled;
16          foreach (@actions)          foreach (@actions)
17          {          {
18              warn "adjusting non-supervised $service ($_)\n";              warn "adjusting non-supervised $service ($_)\n";
# Line 28  diff -Nur e-smith-lib-2.6.0.old/root/usr Line 28  diff -Nur e-smith-lib-2.6.0.old/root/usr
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'


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed