diff -urN smeserver-smbstatus-1.2.old/createlinks smeserver-smbstatus-1.2/createlinks --- smeserver-smbstatus-1.2.old/createlinks 2021-03-28 18:22:19.200819189 +0100 +++ smeserver-smbstatus-1.2/createlinks 2021-03-28 18:25:31.525686696 +0100 @@ -1,45 +1,32 @@ #!/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-smbstatus-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/service); +#and Server Manager panel link +#panel_link('somefunction', 'manager'); #-------------------------------------------------- # functions for manager panel #-------------------------------------------------- my $panel = "manager"; -#panel_link("function1", $panel); +panel_link("smbstatus", $panel); #panel_link("function2", $panel); #-------------------------------------------------- @@ -58,4 +45,3 @@ #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/smbstatus");