diff -urN smeserver-crontab_manager-2.4.old/createlinks smeserver-crontab_manager-2.4/createlinks --- smeserver-crontab_manager-2.4.old/createlinks 2021-03-24 06:09:49.807319619 +0000 +++ smeserver-crontab_manager-2.4/createlinks 2021-03-24 06:11:41.660369950 +0000 @@ -1,61 +1,23 @@ #!/usr/bin/perl -w -# This script creates the symlinks needed by this RPM -# Specific support exists to create symlinks within e-smith web "panels" -# and for links from named "events" directories into the "actions" directory - -sub panel_link -{ - my ($function, $panel) = @_; - - unlink "root/etc/e-smith/web/panels/$panel/cgi-bin/$function"; - symlink("../../../functions/$function", - "root/etc/e-smith/web/panels/$panel/cgi-bin/$function") - or die "Can't symlink to root/etc/e-smith/web/panels/$panel". - "/cgi-bin/$function: $!"; -} - -sub safe_symlink { - my ($from, $to) = @_; - use File::Basename; - use File::Path; - mkpath(dirname($to)); - unlink($to); - symlink($from, $to) or die "Can't create symlink from $from to $to: $!"; -} - -sub event_link +use esmith::Build::CreateLinks qw(:all); +# our event specific for updating with yum without reboot +$event = 'smeserver-crontab_manager-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 + +foreach my $file (qw( + /etc/systemd/system-preset/49-koozali.preset +)) { - my ($action, $event, $level) = @_; - - unlink "root/etc/e-smith/events/${event}/S${level}${action}"; - symlink("../actions/${action}", - "root/etc/e-smith/events/${event}/S${level}${action}") - or die "Can't symlink to " . - "root/etc/e-smith/events/${event}/S${level}${action}: $!"; + templates2events( $file, $event ); } +#action needed in case we have a systemd unit +event_link('systemd-default', $event, '10'); +event_link('systemd-reload', $event, '50'); +#action specific to this package +#event_link('action', $event, '30'); +#services we need to restart +#safe_symlink('restart', 'root/etc/e-smith/events/$event/services2adjust/) +#and Server Mmanager panel link +panel_link('cronmanager', 'manager'); -#-------------------------------------------------- -# functions for manager panel -#-------------------------------------------------- -my $panel = "manager"; - -#panel_link("function1", $panel); -#panel_link("function2", $panel); - -#-------------------------------------------------- -# actions for console-save event: -#-------------------------------------------------- -$event = "console-save"; - -#event_link("action1", $event, "55"); -#event_link("action2", $event, "60"); - -#-------------------------------------------------- -# actions for domain-create event: -#-------------------------------------------------- -$event = "domain-create"; - -#event_link("action1", $event, "55"); -#event_link("action2", $event, "90"); - -safe_symlink("/etc/e-smith/web/functions/wrapper","root/etc/e-smith/web/panels/manager/cgi-bin/cronmanager");