1 |
diff -urN smeserver-sysmon-6.5.old/createlinks smeserver-sysmon-6.5/createlinks |
2 |
--- smeserver-sysmon-6.5.old/createlinks 2022-08-03 15:59:11.836382422 +1000 |
3 |
+++ smeserver-sysmon-6.5/createlinks 2022-08-03 16:21:21.389855128 +1000 |
4 |
@@ -4,16 +4,26 @@ |
5 |
use esmith::Build::Backup qw(:all); |
6 |
|
7 |
panel_link("sysmon", "manager"); |
8 |
+# our event specific for updating with yum without reboot |
9 |
+$event = 'smeserver-sysmon-update'; |
10 |
+#add here the path to your templates needed to expand |
11 |
+#see the /etc/systemd/system-preset/49-koozali.preset should be present for systemd integration on all you yum update event |
12 |
|
13 |
-service_link_enhanced("sysmon", "K03", "0"); |
14 |
-service_link_enhanced("sysmon", "K03", "1"); |
15 |
-service_link_enhanced("sysmon", "S97", "2"); |
16 |
-service_link_enhanced("sysmon", "S97", "3"); |
17 |
-service_link_enhanced("sysmon", "S97", "4"); |
18 |
-service_link_enhanced("sysmon", "S97", "5"); |
19 |
-service_link_enhanced("sysmon", "K03", "6"); |
20 |
-service_link_enhanced("sysmon", "S97", "7"); |
21 |
+foreach my $file (qw( |
22 |
+ /etc/dar/DailyBackup.dcf |
23 |
+ /etc/systemd/system-preset/49-koozali.preset |
24 |
+ /usr/lib/systemd/system/sysmon.service.d/50koozali.conf |
25 |
+)) |
26 |
+{ |
27 |
+ templates2events( $file, $event ); |
28 |
+}; |
29 |
+#action needed in case we have a systemd unit |
30 |
+event_link('systemd-default', $event, '10'); |
31 |
+event_link('systemd-reload', $event, '50'); |
32 |
+#services we need to restart |
33 |
+safe_symlink('restart',"root/etc/e-smith/events/$event/services2adjust/sysmon"); |
34 |
|
35 |
backup_includes("smeserver-sysmon", qw( |
36 |
/var/lib/rrd/ |
37 |
-)); |
38 |
\ No newline at end of file |
39 |
+)); |
40 |
+ |
41 |
diff -urN smeserver-sysmon-6.5.old/root/etc/rc.d/init.d/sysmon smeserver-sysmon-6.5/root/etc/rc.d/init.d/sysmon |
42 |
--- smeserver-sysmon-6.5.old/root/etc/rc.d/init.d/sysmon 2022-08-03 15:59:11.836382422 +1000 |
43 |
+++ smeserver-sysmon-6.5/root/etc/rc.d/init.d/sysmon 1970-01-01 10:00:00.000000000 +1000 |
44 |
@@ -1,44 +0,0 @@ |
45 |
-#!/bin/sh |
46 |
-# |
47 |
-# sysmon: Starts the sysmon daemon |
48 |
-# |
49 |
-# chkconfig: 2345 97 03 |
50 |
-# processname: sysmon |
51 |
- |
52 |
-# Source function library. |
53 |
-. /etc/rc.d/init.d/functions |
54 |
- |
55 |
-RETVAL=0 |
56 |
- |
57 |
-# See how we were called. |
58 |
-case "$1" in |
59 |
- start) |
60 |
- echo -n "Starting sysmon daemon: " |
61 |
- daemon sysmon |
62 |
- RETVAL=$? |
63 |
- echo |
64 |
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sysmon |
65 |
- ;; |
66 |
- stop) |
67 |
- echo -n "Stopping sysmon daemon: " |
68 |
- killproc sysmon |
69 |
- RETVAL=$? |
70 |
- rm -f /var/lock/subsys/sysmon && rm -f /var/lock/sysmon |
71 |
- echo |
72 |
- ;; |
73 |
- status) |
74 |
- status sysmon |
75 |
- RETVAL=$? |
76 |
- ;; |
77 |
- restart) |
78 |
- $0 stop |
79 |
- $0 start |
80 |
- RETVAL=$? |
81 |
- ;; |
82 |
- *) |
83 |
- echo "Usage: $0 {start|stop|status|restart}" |
84 |
- exit 1 |
85 |
-esac |
86 |
- |
87 |
-exit $RETVAL |
88 |
- |
89 |
diff -urN smeserver-sysmon-6.5.old/root/usr/lib/systemd/system/sysmon.service smeserver-sysmon-6.5/root/usr/lib/systemd/system/sysmon.service |
90 |
--- smeserver-sysmon-6.5.old/root/usr/lib/systemd/system/sysmon.service 1970-01-01 10:00:00.000000000 +1000 |
91 |
+++ smeserver-sysmon-6.5/root/usr/lib/systemd/system/sysmon.service 2022-08-05 12:02:45.000000000 +1000 |
92 |
@@ -0,0 +1,16 @@ |
93 |
+ |
94 |
+[Unit] |
95 |
+Description=System Monitor |
96 |
+After=network-online.target |
97 |
+Wants=network-online.target |
98 |
+ |
99 |
+[Service] |
100 |
+Type=forking |
101 |
+ExecStartPre=-/sbin/e-smith/service-status sysmon |
102 |
+ExecStartPre=-/sbin/e-smith/expand-template /usr/lib/systemd/system/sysmon.service.d/50koozali.conf |
103 |
+ExecStart= |
104 |
+ExecStart=-/usr/sbin/sysmon |
105 |
+ |
106 |
+[Install] |
107 |
+WantedBy= sme-server.target |
108 |
+ |
109 |
diff -urN smeserver-sysmon-6.5.old/root/usr/sbin/sysmon smeserver-sysmon-6.5/root/usr/sbin/sysmon |
110 |
--- smeserver-sysmon-6.5.old/root/usr/sbin/sysmon 2022-08-15 20:46:06.186627886 +1000 |
111 |
+++ smeserver-sysmon-6.5/root/usr/sbin/sysmon 2022-08-15 20:46:32.897160735 +1000 |
112 |
@@ -74,7 +74,7 @@ |
113 |
{ |
114 |
`/usr/lib64/sa/sadc 1 1 /var/lib/rrd/sysmon.process > /dev/null 2>&1; /usr/lib64/sa/sadc 1 1 /var/lib/rrd/sysmon.stats > /dev/null 2>&1`;} |
115 |
my @sardata; |
116 |
- if ( -x '/usr/bin/sadf' ) { @sardata=`/usr/bin/sadf -- -qrbuS -n DEV /var/lib/rrd/sysmon.process 2> /dev/null`; }# sadf |
117 |
+ if ( -x '/usr/bin/sadf' ) { @sardata=`/usr/bin/sadf -U -- -qrbuS -n DEV /var/lib/rrd/sysmon.process 2> /dev/null`; }# sadf |
118 |
else { @sardata = `/usr/bin/sar -hqruS -P ALL -n DEV -f /var/lib/rrd/sysmon.process 2> /dev/null`; }# old systat |
119 |
unlink("/var/lib/rrd/sysmon.process"); |
120 |
|