diff -urN smeserver-bandwidthd-2.0.1.2.old/createlinks smeserver-bandwidthd-2.0.1.2/createlinks --- smeserver-bandwidthd-2.0.1.2.old/createlinks 2021-02-02 18:44:48.107733852 +0000 +++ smeserver-bandwidthd-2.0.1.2/createlinks 2021-02-03 11:26:32.565366516 +0000 @@ -9,12 +9,11 @@ templates2events("/etc/e-smith/sql/init/80bandwidthd", qw( conf-bandwidthd bootstrap-console-save post-upgrade)); templates2events("/etc/bandwidthd.conf", qw( conf-bandwidthd bootstrap-console-save post-upgrade)); templates2events("/var/www/bandwidthd/phphtdocs/config.conf", qw( conf-bandwidthd bootstrap-console-save post-upgrade)); - templates2events("/etc/httpd/conf/httpd.conf", qw( conf-bandwidthd )); # services to launch on event safe_symlink("restart", "root/etc/e-smith/events/conf-bandwidthd/services2adjust/bandwidthd"); - safe_symlink("sigusr1", "root/etc/e-smith/events/conf-bandwidthd/services2adjust/httpd-e-smith"); + safe_symlink("restart", "root/etc/e-smith/events/conf-bandwidthd/services2adjust/httpd-e-smith"); safe_symlink("restart", "root/etc/e-smith/events/conf-bandwidthd/services2adjust/mysql.init"); # links for rc.d from init.d @@ -26,26 +25,34 @@ safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/var/www/bandwidthd/phphtdocs/config.conf/template-begin"); safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/var/www/bandwidthd/phphtdocs/config.conf/template-end"); -#safe_symlink("../../../functions/wrapper", "root/etc/e-smith/web/panels/manager/cgi-bin/bandwidthd"); #Server manager link +#safe_symlink("../../../functions/wrapper", "root/etc/e-smith/web/panels/manager/cgi-bin/bandwidthd"); panel_link("bandwidthd","manager"); -# rpm update action (invoked by yum on install and update -$contrib = "smeserver-bandwidthd"; -event_actions("$contrib-update", qw( - systemd-default 10 -)); - -event_templates("$contrib-update", qw( - /etc/httpd/conf/httpd.conf - /etc/crontab - /etc/systemd/system-preset/49-koozali.preset - -)); - -event_services("$contrib-update", qw( - httpd-e-smith sigusr1 - php-fpm reload -)); - +# our event specific for updating with yum without reboot +$event = "smeserver-bandwidthd-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 + /etc/e-smith/sql/init/80bandwidthd + /etc/bandwidthd.conf + /var/www/bandwidthd/phphtdocs/config.conf + /etc/httpd/conf/httpd.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"); + +#action specific to this package +#event_link("conf-timezone", $event, "30"); +#services we need to restart +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/bandwidthd"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); +safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init");