diff -Nur e-smith-base-5.8.0.old/createlinks e-smith-base-5.8.0/createlinks --- e-smith-base-5.8.0.old/createlinks 2020-11-14 22:22:41.104000000 -0500 +++ e-smith-base-5.8.0/createlinks 2020-11-14 22:31:36.858000000 -0500 @@ -6,6 +6,8 @@ templates2events("/etc/selinux/config", qw(post-install post-upgrade e-smith-base-update)); +templates2events("/etc/systemd/system-preset/49-koozali.preset", qw(post-install post-upgrade e-smith-base-update console-save bootstrap-console-save bootstrap-ldap-save)); + # give the correct configuration file of dhcpd.conf templates2events("/etc/dhcp/dhcpd.conf", qw(bootstrap-console-save e-smith-base-update)); diff -Nur e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/05config e-smith-base-5.8.0/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/05config --- e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/05config 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-base-5.8.0/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/05config 2020-11-14 22:24:59.983000000 -0500 @@ -0,0 +1,7 @@ +# Koozali SME Server +# auto generated list of services +{ +use esmith::ConfigDB; +our $c = esmith::ConfigDB->open_ro || die "Couldn't opeen the configuration database\n"; +my $OUT =""; +} diff -Nur e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/20services e-smith-base-5.8.0/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/20services --- e-smith-base-5.8.0.old/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/20services 1969-12-31 19:00:00.000000000 -0500 +++ e-smith-base-5.8.0/root/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/20services 2020-11-14 22:25:31.354000000 -0500 @@ -0,0 +1,19 @@ +{ +#list of exception services +#those services might keep some traces in init.d +my @list = qw(bootstrap-console masq mysql.init wan); + +foreach my $service ($c->get_all_by_prop(type => 'service')){ + my $status = $service->prop('status') || 'enabled'; + my $servicename = $service->prop('SystemdUnit') || $service->key . ".service" || ""; + next unless $servicename || $servicename eq ".service"; + $status = ($status eq "enabled") ? "enable" : "disable"; + unless ( $service->key ~~ @list ) { + $status = "disable" if -e "/etc/rc.d/init.d/".$service->key || -e "/etc/rc.d/init.d/supervise/".$service->key; + } + $OUT .= "# Systemd service file does not exist : " unless -e "/usr/lib/systemd/system/$servicename" || -e "/etc/lib/systemd/system/$servicename"; + $OUT .= "$status $servicename\n"; + + } + +}