diff -urN smeserver-sysmon-6.5.old/createlinks smeserver-sysmon-6.5/createlinks --- smeserver-sysmon-6.5.old/createlinks 2022-08-03 15:59:11.836382422 +1000 +++ smeserver-sysmon-6.5/createlinks 2022-08-03 16:21:21.389855128 +1000 @@ -4,16 +4,26 @@ use esmith::Build::Backup qw(:all); panel_link("sysmon", "manager"); +# our event specific for updating with yum without reboot +$event = 'smeserver-sysmon-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 -service_link_enhanced("sysmon", "K03", "0"); -service_link_enhanced("sysmon", "K03", "1"); -service_link_enhanced("sysmon", "S97", "2"); -service_link_enhanced("sysmon", "S97", "3"); -service_link_enhanced("sysmon", "S97", "4"); -service_link_enhanced("sysmon", "S97", "5"); -service_link_enhanced("sysmon", "K03", "6"); -service_link_enhanced("sysmon", "S97", "7"); +foreach my $file (qw( + /etc/dar/DailyBackup.dcf + /etc/systemd/system-preset/49-koozali.preset + /usr/lib/systemd/system/sysmon.service.d/50koozali.conf +)) +{ + templates2events( $file, $event ); +}; +#action needed in case we have a systemd unit +event_link('systemd-default', $event, '10'); +event_link('systemd-reload', $event, '50'); +#services we need to restart +safe_symlink('restart',"root/etc/e-smith/events/$event/services2adjust/sysmon"); backup_includes("smeserver-sysmon", qw( /var/lib/rrd/ -)); \ No newline at end of file +)); + 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 --- smeserver-sysmon-6.5.old/root/etc/rc.d/init.d/sysmon 2022-08-03 15:59:11.836382422 +1000 +++ smeserver-sysmon-6.5/root/etc/rc.d/init.d/sysmon 1970-01-01 10:00:00.000000000 +1000 @@ -1,44 +0,0 @@ -#!/bin/sh -# -# sysmon: Starts the sysmon daemon -# -# chkconfig: 2345 97 03 -# processname: sysmon - -# Source function library. -. /etc/rc.d/init.d/functions - -RETVAL=0 - -# See how we were called. -case "$1" in - start) - echo -n "Starting sysmon daemon: " - daemon sysmon - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sysmon - ;; - stop) - echo -n "Stopping sysmon daemon: " - killproc sysmon - RETVAL=$? - rm -f /var/lock/subsys/sysmon && rm -f /var/lock/sysmon - echo - ;; - status) - status sysmon - RETVAL=$? - ;; - restart) - $0 stop - $0 start - RETVAL=$? - ;; - *) - echo "Usage: $0 {start|stop|status|restart}" - exit 1 -esac - -exit $RETVAL - 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 --- smeserver-sysmon-6.5.old/root/usr/lib/systemd/system/sysmon.service 1970-01-01 10:00:00.000000000 +1000 +++ smeserver-sysmon-6.5/root/usr/lib/systemd/system/sysmon.service 2022-08-05 12:02:45.000000000 +1000 @@ -0,0 +1,16 @@ + +[Unit] +Description=System Monitor +After=network-online.target +Wants=network-online.target + +[Service] +Type=forking +ExecStartPre=-/sbin/e-smith/service-status sysmon +ExecStartPre=-/sbin/e-smith/expand-template /usr/lib/systemd/system/sysmon.service.d/50koozali.conf +ExecStart= +ExecStart=-/usr/sbin/sysmon + +[Install] +WantedBy= sme-server.target + diff -urN smeserver-sysmon-6.5.old/root/usr/sbin/sysmon smeserver-sysmon-6.5/root/usr/sbin/sysmon --- smeserver-sysmon-6.5.old/root/usr/sbin/sysmon 2022-08-15 20:46:06.186627886 +1000 +++ smeserver-sysmon-6.5/root/usr/sbin/sysmon 2022-08-15 20:46:32.897160735 +1000 @@ -74,7 +74,7 @@ { `/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`;} my @sardata; - if ( -x '/usr/bin/sadf' ) { @sardata=`/usr/bin/sadf -- -qrbuS -n DEV /var/lib/rrd/sysmon.process 2> /dev/null`; }# sadf + if ( -x '/usr/bin/sadf' ) { @sardata=`/usr/bin/sadf -U -- -qrbuS -n DEV /var/lib/rrd/sysmon.process 2> /dev/null`; }# sadf else { @sardata = `/usr/bin/sar -hqruS -P ALL -n DEV -f /var/lib/rrd/sysmon.process 2> /dev/null`; }# old systat unlink("/var/lib/rrd/sysmon.process");