--- rpms/e-smith-nutUPS/sme10/e-smith-nutUPS-2.6.0-bz9423-bz11146.patch 2020/11/18 22:12:50 1.1 +++ rpms/e-smith-nutUPS/sme10/e-smith-nutUPS-2.6.0-bz9423-bz11146.patch 2020/11/27 05:14:55 1.5 @@ -24,7 +24,7 @@ diff -Nur e-smith-nutUPS-2.6.0.old/creat } + +my $event="e-smith-nutUPS-update"; -+safe_symlink("try-reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/nut"); ++safe_symlink("try-restart", "root/etc/e-smith/events/$event/services2adjust/nut"); +templates2events("/etc/systemd/system-preset/49-koozali.preset", $event); +event_link("systemd-default", $event, "06"); diff -Nur e-smith-nutUPS-2.6.0.old/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/70nutUPS e-smith-nutUPS-2.6.0/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/70nutUPS @@ -36,15 +36,15 @@ diff -Nur e-smith-nutUPS-2.6.0.old/root/ +$nutstatus = $nut{status} || 'disabled'; +$master = $nut{Master} || 'yes'; + -+if ($nutstatus eq ''enabled') { -+ $OUT .= "enable nut-server.service" if ($master eq 'yes'); -+ $OUT .= "disabled nut-server.service" unless ($master eq 'yes'); -+ $OUT .= "enable nut-monitor.service"; ++if ($nutstatus eq 'enabled') { ++ $OUT .= "enable nut-server.service\n" if ($master eq 'yes'); ++ $OUT .= "disable nut-server.service\n" unless ($master eq 'yes'); ++ $OUT .= "enable nut-monitor.service\n"; + } +else + { -+ $OUT .= "enable nut-server.service"; -+ $OUT .= "enable nut-monitor.service"; ++ $OUT .= "disable nut-server.service\n"; ++ $OUT .= "disable nut-monitor.service\n"; + } +} diff -Nur e-smith-nutUPS-2.6.0.old/root/etc/e-smith/templates/usr/lib/systemd/system/nut-monitor.service.d/20unit e-smith-nutUPS-2.6.0/root/etc/e-smith/templates/usr/lib/systemd/system/nut-monitor.service.d/20unit @@ -96,12 +96,12 @@ diff -Nur e-smith-nutUPS-2.6.0.old/root/ + +[Service] +ExecStartPre=/sbin/e-smith/service-status nut -+ExecStartPre=- /sbin/e-smith/expand-template /etc/sysconfig/ups -+ExecStartPre=- /sbin/e-smith/expand-template /etc/ups/ups.conf -+ExecStartPre=- /etc/ups/upsd.conf -+ExecStartPre=- /etc/ups/upsd.users -+ExecStartPre=- /etc/ups/upsmon.conf -+ExecStartPre=- /etc/ups/upssched.conf ++ExecStartPre=-/sbin/e-smith/expand-template /etc/sysconfig/ups ++ExecStartPre=-/sbin/e-smith/expand-template /etc/ups/ups.conf ++ExecStartPre=-/etc/ups/upsd.conf ++ExecStartPre=-/etc/ups/upsd.users ++ExecStartPre=-/etc/ups/upsmon.conf ++ExecStartPre=-/etc/ups/upssched.conf + +# The dummy program will exit +Type=oneshot