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/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/10Unit smeserver-sysmon-6.5/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/10Unit --- smeserver-sysmon-6.5.old/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/10Unit 1970-01-01 10:00:00.000000000 +1000 +++ smeserver-sysmon-6.5/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/10Unit 2022-08-03 16:10:56.207980079 +1000 @@ -0,0 +1,6 @@ + +[Unit] +Description=System Monitor +After=network-online.target +Wants=network-online.target + diff -urN smeserver-sysmon-6.5.old/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/20Service smeserver-sysmon-6.5/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/20Service --- smeserver-sysmon-6.5.old/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/20Service 1970-01-01 10:00:00.000000000 +1000 +++ smeserver-sysmon-6.5/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/20Service 2022-08-03 16:12:26.238523740 +1000 @@ -0,0 +1,5 @@ + +[Service] +ExecStart= +ExecStart=/usr/sbin/sysmon + diff -urN smeserver-sysmon-6.5.old/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/30Install smeserver-sysmon-6.5/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/30Install --- smeserver-sysmon-6.5.old/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/30Install 1970-01-01 10:00:00.000000000 +1000 +++ smeserver-sysmon-6.5/root/etc/e-smith/templates/usr/lib/systemd/system/sysmon.service.d/50koozali.conf/30Install 2022-08-03 16:11:05.607828018 +1000 @@ -0,0 +1,3 @@ + +[Install] +WantedBy=sme-server.target 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,12 @@ + +[Unit] +Description=System Monitor +After=network-online.target +Wants=network-online.target + +[Service] +ExecStart= +ExecStart=/usr/bin/perl /usr/sbin/sysmon + +[Install] +WantedBy= sme-server.target