1 |
diff -Nur --no-dereference smeserver-fetchmail-1.6.old/createlinks smeserver-fetchmail-1.6/createlinks |
diff -Nur --no-dereference smeserver-fetchmail-1.6.old/createlinks smeserver-fetchmail-1.6/createlinks |
2 |
--- smeserver-fetchmail-1.6.old/createlinks 2022-07-28 10:33:25.211000000 -0400 |
--- smeserver-fetchmail-1.6.old/createlinks 2022-07-28 10:33:25.211000000 -0400 |
3 |
+++ smeserver-fetchmail-1.6/createlinks 2022-07-28 11:10:53.157000000 -0400 |
+++ smeserver-fetchmail-1.6/createlinks 2022-07-28 11:23:38.931000000 -0400 |
4 |
@@ -12,8 +12,9 @@ |
@@ -2,24 +2,21 @@ |
5 |
|
use esmith::Build::CreateLinks qw(:all); |
6 |
|
# our event specific for updating with yum without reboot |
7 |
|
$event = 'smeserver-fetchmail-update'; |
8 |
|
-#add here the path to your templates needed to expand |
9 |
|
-#see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event |
10 |
|
|
11 |
|
foreach my $file (qw( |
12 |
|
- /etc/systemd/system-preset/49-koozali.preset |
13 |
|
+ /etc/fetchmail |
14 |
|
+ /etc/startmail |
15 |
|
+ /etc/crontab |
16 |
|
)) |
17 |
|
{ |
18 |
templates2events( $file, $event ); |
templates2events( $file, $event ); |
19 |
} |
} |
20 |
#action needed in case we have a systemd unit |
#action needed in case we have a systemd unit |
22 |
-event_link('systemd-reload', $event, '50'); |
-event_link('systemd-reload', $event, '50'); |
23 |
+event_link('systemd-default', $event, '88'); |
+event_link('systemd-default', $event, '88'); |
24 |
+event_link('systemd-reload', $event, '89'); |
+event_link('systemd-reload', $event, '89'); |
25 |
+event_link('fetchmail-migrate-fetchids', $event, '91'); |
+event_link('fetchmail-migrate-fetchids', $event, '89'); |
26 |
#action specific to this package |
#action specific to this package |
27 |
#event_link('action', $event, '30'); |
-#event_link('action', $event, '30'); |
28 |
#services we need to restart |
-#services we need to restart |
29 |
|
#safe_symlink('restart',root/etc/e-smith/events/$event/services2adjust/service); |
30 |
|
-#and Server Manager panel link |
31 |
|
-#panel_link('somefunction', 'manager'); |
32 |
|
|
33 |
|
#-------------------------------------------------- |
34 |
|
# functions for manager panel |
35 |
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 |
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 |
36 |
--- 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.old/root/etc/e-smith/events/actions/fetchmail-migrate-fetchids 1969-12-31 19:00:00.000000000 -0500 |
37 |
+++ smeserver-fetchmail-1.6/root/etc/e-smith/events/actions/fetchmail-migrate-fetchids 2022-07-28 11:06:55.577000000 -0400 |
+++ smeserver-fetchmail-1.6/root/etc/e-smith/events/actions/fetchmail-migrate-fetchids 2022-07-28 23:44:33.009000000 -0400 |
38 |
@@ -0,0 +1,15 @@ |
@@ -0,0 +1,13 @@ |
39 |
+#!/usr/bin/perl |
+#!/usr/bin/perl |
40 |
+ |
+ |
|
+use File::Copy; |
|
|
+ |
|
41 |
+my $original_file = "/run/lock/fetchmail/.fetchids"; |
+my $original_file = "/run/lock/fetchmail/.fetchids"; |
42 |
+my $new_file = "/var/lib/fetchmail/.fetchids"; |
+my $new_file = "/var/lib/fetchmail/.fetchids"; |
|
+my $status=`/usr/bin/systemctl is-active fetchmail.service`; |
|
43 |
+ |
+ |
44 |
+exit 0 if ( -f $new_file ) ; |
+exit 0 if ( -f $new_file ) ; |
45 |
+exit 0 unless ( -f $original_file ) ; |
+exit 0 unless ( -f $original_file ) ; |
46 |
+ |
+while ( -f /run/lock/fetchmail/fetchmail.pid ) { |
47 |
+system("/usr/bin/systemctl stop fetchmail.service") if ( $status eq "active"); |
+ print "waiting for fetchmail to finish"; |
48 |
+#move($original_file, $new_file) or warn "The move operation failed: $!"; |
+ sleep 10; |
49 |
+system("/usr/bin/mv $original_file $new_file") == 0 or warn "The move operation failed: $!"; |
+} |
50 |
+system("/usr/bin/systemctl start fetchmail.service") if ( $status eq "active"); |
+# ideally suspend fetchmail of wait for it to stop |
51 |
|
+system("/usr/bin/mv $original_file $new_file") == 0 or warn "The move $original_file $new_file operation failed: $!"; |
52 |
|
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 |
53 |
|
--- smeserver-fetchmail-1.6.old/root/etc/e-smith/templates/etc/fetchmail/90fetchmail 2022-07-28 10:33:25.177000000 -0400 |
54 |
|
+++ smeserver-fetchmail-1.6/root/etc/e-smith/templates/etc/fetchmail/90fetchmail 2022-07-28 11:17:18.575000000 -0400 |
55 |
|
@@ -322,6 +322,7 @@ |
56 |
|
my $size = $db->get_prop('qmail','MaxMessageSize') || '0'; |
57 |
|
my $mdbg='-l' . $size . ' -d0 --silent --syslog'; |
58 |
|
if($Debug eq "YES") { $mdbg='-l' . $size . ' -d0 --verbose --syslog'; } |
59 |
|
+ $mdbg .= " -i /var/lib/fetchmail/.fetchids "; # fix SME: 11979 |
60 |
|
|
61 |
|
my $staticvalue = "/usr/bin/fetchmail $mdbg --fetchmailrc - <<EOF\n" ; |
62 |
|
$staticvalue .= "set postmaster \"postmaster\@$dom\"\n" ; |