/[smeserver]/rpms/e-smith-base/sme10/e-smith-base-5.8.1-bz11950-symlinked-logs.patch
ViewVC logotype

Contents of /rpms/e-smith-base/sme10/e-smith-base-5.8.1-bz11950-symlinked-logs.patch

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


Revision 1.6 - (show annotations) (download)
Fri Sep 9 05:53:40 2022 UTC (2 years, 2 months ago) by jpp
Branch: MAIN
CVS Tags: e-smith-base-5_8_1-25_el7_sme, e-smith-base-5_8_1-18_el7_sme, e-smith-base-5_8_1-29_el7_sme, e-smith-base-5_8_1-21_el7_sme, e-smith-base-5_8_1-31_el7_sme, e-smith-base-5_8_1-28_el7_sme, e-smith-base-5_8_1-19_el7_sme, e-smith-base-5_8_1-22_el7_sme, e-smith-base-5_8_1-24_el7_sme, e-smith-base-5_8_1-27_el7_sme, e-smith-base-5_8_1-23_el7_sme, e-smith-base-5_8_1-20_el7_sme, e-smith-base-5_8_1-30_el7_sme, e-smith-base-5_8_1-26_el7_sme, HEAD
Changes since 1.5: +2 -2 lines
* Fri Sep 09 2022 Jean-Philippe Pialasse <tests@pialasse.com> 5.8.1-18.sme
- fix comparison operator for logrotate fix [SME: 11950]
  changing also restart to reload [SME: 12164]

1 diff -Nur --no-dereference e-smith-base-5.8.1.old/createlinks e-smith-base-5.8.1/createlinks
2 --- e-smith-base-5.8.1.old/createlinks 2022-04-16 23:39:45.153000000 -0400
3 +++ e-smith-base-5.8.1/createlinks 2022-04-16 23:46:57.368000000 -0400
4 @@ -307,8 +307,9 @@
5 templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
6 event_link("systemd-journald", $event, "02");
7 event_link("fix-startup", $event, "05");
8 -event_link("rotate_logfiles", $event, "05");
9 event_link("init-accounts", $event, "05");
10 +event_link("logrotate-migrate", $event, "06");
11 +event_link("rotate_logfiles", $event, "07");
12 event_link("set-hostname", $event, "10");
13 event_link("rmmod-bonding", $event, "10");
14 event_link("conf-startup", $event, "10");
15 @@ -446,8 +447,8 @@
16 templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
17 event_link("systemd-journald", $event, "02");
18 event_link("fix-startup", $event, "05");
19 -event_link("rotate_logfiles", $event, "05");
20 event_link("init-accounts", $event, "05");
21 +event_link("rotate_logfiles", $event, "07");
22 event_link("init-passwords", $event, "10");
23 event_link("conf-startup", $event, "10");
24 event_link("user-rsshd", $event, "16");
25 @@ -466,8 +467,9 @@
26 templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
27 event_link("systemd-journald", $event, "02");
28 event_link("fix-startup", $event, "05");
29 -event_link("rotate_logfiles", $event, "05");
30 event_link("init-accounts", $event, "05");
31 +event_link("logrotate-migrate", $event, "06");
32 +event_link("rotate_logfiles", $event, "07");
33 event_link("conf-startup", $event, "10");
34 event_link("user-lock-passwd", $event, "15");
35 event_link("group-modify-unix", $event, "15");
36 @@ -583,7 +585,8 @@
37
38 $event = "logrotate";
39
40 -event_link("rotate_logfiles", $event, "05");
41 +event_link("logrotate-migrate", $event, "06");
42 +event_link("rotate_logfiles", $event, "07");
43 event_link("purge-old-logs", $event, "75");
44
45 safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
46 diff -Nur --no-dereference e-smith-base-5.8.1.old/root/etc/e-smith/events/actions/logrotate-migrate e-smith-base-5.8.1/root/etc/e-smith/events/actions/logrotate-migrate
47 --- e-smith-base-5.8.1.old/root/etc/e-smith/events/actions/logrotate-migrate 1969-12-31 19:00:00.000000000 -0500
48 +++ e-smith-base-5.8.1/root/etc/e-smith/events/actions/logrotate-migrate 2022-04-16 23:59:07.124000000 -0400
49 @@ -0,0 +1,52 @@
50 +#!/bin/bash
51 +# this script is to migrate old symlink log to regular file in order
52 +# to be handled by logrotate
53 +
54 +#known files that could be symlinks
55 +FILES="/var/log/cron
56 +/var/log/maillog
57 +/var/log/messages
58 +/var/log/secure
59 +/var/log/spooler
60 +/var/log/boot.log
61 +/var/log/httpd/admin_access_log
62 +/var/log/httpd/admin_error_log
63 +/var/log/httpd/access_log
64 +/var/log/httpd/error_log
65 +/var/log/httpd/fpbx_error_log
66 +/var/log/httpd/fpbx_access_log
67 +/var/log/httpd/bkpc_access_log
68 +/var/log/httpd/bkpc_error_log
69 +/var/log/httpd/issoqlog_access_log
70 +/var/log/httpd/isoqlog_access_log
71 +/var/log/httpd/isoqlog_error_log
72 +/var/log/httpd/pki_access_log
73 +/var/log/httpd/pki_error_log
74 +/var/log/pluto/pluto.log"
75 +
76 +
77 +#counter
78 +found=0
79 +
80 +# could do also $(find /var/log/ -type l)
81 +for f in $FILES
82 +do
83 + if [ -L "$f" ]; then
84 + echo "Processing $f"
85 + mylink=$(readlink "$f")
86 + unlink $f
87 + touch $f
88 + if [ -f "$mylink" ]; then
89 + cp --attributes-only "$mylink" "$f"
90 + fi
91 + ((found+=1))
92 + fi
93 +done
94 +
95 +# restart the needed services
96 +if [ $found -gt 0 ] ; then
97 + /usr/bin/systemctl daemon-reload > /dev/null 2>/dev/null
98 + /usr/bin/systemctl reload httpd-*.service > /dev/null 2>/dev/null
99 + /usr/bin/systemctl restart rsyslog.service > /dev/null 2>/dev/null
100 +fi
101 +

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