--- rpms/smeserver-fetchmail/contribs10/smeserver-fetchmail-1.6-bz11979-ids.patch 2022/07/28 15:21:50 1.2 +++ rpms/smeserver-fetchmail/contribs10/smeserver-fetchmail-1.6-bz11979-ids.patch 2022/07/29 03:45:23 1.3 @@ -1,7 +1,20 @@ diff -Nur --no-dereference smeserver-fetchmail-1.6.old/createlinks smeserver-fetchmail-1.6/createlinks --- smeserver-fetchmail-1.6.old/createlinks 2022-07-28 10:33:25.211000000 -0400 -+++ smeserver-fetchmail-1.6/createlinks 2022-07-28 11:10:53.157000000 -0400 -@@ -12,8 +12,9 @@ ++++ smeserver-fetchmail-1.6/createlinks 2022-07-28 11:23:38.931000000 -0400 +@@ -2,24 +2,21 @@ + use esmith::Build::CreateLinks qw(:all); + # our event specific for updating with yum without reboot + $event = 'smeserver-fetchmail-update'; +-#add here the path to your templates needed to expand +-#see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event + + foreach my $file (qw( +- /etc/systemd/system-preset/49-koozali.preset ++ /etc/fetchmail ++ /etc/startmail ++ /etc/crontab + )) + { templates2events( $file, $event ); } #action needed in case we have a systemd unit @@ -9,29 +22,33 @@ diff -Nur --no-dereference smeserver-fet -event_link('systemd-reload', $event, '50'); +event_link('systemd-default', $event, '88'); +event_link('systemd-reload', $event, '89'); -+event_link('fetchmail-migrate-fetchids', $event, '91'); ++event_link('fetchmail-migrate-fetchids', $event, '89'); #action specific to this package - #event_link('action', $event, '30'); - #services we need to restart +-#event_link('action', $event, '30'); +-#services we need to restart + #safe_symlink('restart',root/etc/e-smith/events/$event/services2adjust/service); +-#and Server Manager panel link +-#panel_link('somefunction', 'manager'); + + #-------------------------------------------------- + # functions for manager panel diff -Nur --no-dereference smeserver-fetchmail-1.6.old/root/etc/e-smith/events/actions/fetchmail-migrate-fetchids smeserver-fetchmail-1.6/root/etc/e-smith/events/actions/fetchmail-migrate-fetchids --- smeserver-fetchmail-1.6.old/root/etc/e-smith/events/actions/fetchmail-migrate-fetchids 1969-12-31 19:00:00.000000000 -0500 -+++ smeserver-fetchmail-1.6/root/etc/e-smith/events/actions/fetchmail-migrate-fetchids 2022-07-28 11:06:55.577000000 -0400 -@@ -0,0 +1,15 @@ ++++ smeserver-fetchmail-1.6/root/etc/e-smith/events/actions/fetchmail-migrate-fetchids 2022-07-28 23:44:33.009000000 -0400 +@@ -0,0 +1,13 @@ +#!/usr/bin/perl + -+use File::Copy; -+ +my $original_file = "/run/lock/fetchmail/.fetchids"; +my $new_file = "/var/lib/fetchmail/.fetchids"; -+my $status=`/usr/bin/systemctl is-active fetchmail.service`; + +exit 0 if ( -f $new_file ) ; +exit 0 unless ( -f $original_file ) ; -+ -+system("/usr/bin/systemctl stop fetchmail.service") if ( $status eq "active"); -+#move($original_file, $new_file) or warn "The move operation failed: $!"; -+system("/usr/bin/mv $original_file $new_file") == 0 or warn "The move operation failed: $!"; -+system("/usr/bin/systemctl start fetchmail.service") if ( $status eq "active"); ++while ( -f /run/lock/fetchmail/fetchmail.pid ) { ++ print "waiting for fetchmail to finish"; ++ sleep 10; ++} ++# ideally suspend fetchmail of wait for it to stop ++system("/usr/bin/mv $original_file $new_file") == 0 or warn "The move $original_file $new_file operation failed: $!"; diff -Nur --no-dereference smeserver-fetchmail-1.6.old/root/etc/e-smith/templates/etc/fetchmail/90fetchmail smeserver-fetchmail-1.6/root/etc/e-smith/templates/etc/fetchmail/90fetchmail --- smeserver-fetchmail-1.6.old/root/etc/e-smith/templates/etc/fetchmail/90fetchmail 2022-07-28 10:33:25.177000000 -0400 +++ smeserver-fetchmail-1.6/root/etc/e-smith/templates/etc/fetchmail/90fetchmail 2022-07-28 11:17:18.575000000 -0400