smeserver-shared-folders/createlinks

116 lines
4.7 KiB
Plaintext
Raw Permalink Normal View History

#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
# our event specific for updating with yum without reboot
$event = "smeserver-shared-folders-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/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("some event", $event, "30");
#services we need to restart
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
#
#--------------------------------------------------
# functions for manager panel
#--------------------------------------------------
my $panel = "manager";
panel_link("shares", $panel);
panel_link("userpanel-encfs", $panel);
#--------------------------------------------------
# actions for group-delete and user-delete events
#--------------------------------------------------
foreach my $event (qw/group-delete user-delete/) {
event_link("group-share-modify", $event, "10");
}
#--------------------------------------------------
# actions for share-delete event
#--------------------------------------------------
$event = "share-delete";
event_link("share-delete", $event, "15");
foreach my $event (qw(share-create share-modify share-modify-files)){
event_link("share-modify", $event, "15");
}
event_link("share-dump-attributes", "pre-backup", "80");
foreach my $event (qw(share-create share-modify share-delete share-modify-servers)){
templates2events("/etc/samba/smb.conf", $event);
templates2events("/etc/httpd/conf/httpd.conf", $event);
templates2events("/etc/rsyncd.conf", $event);
templates2events("/etc/proftpd.conf", $event);
safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/smbd");
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyncd");
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/ftp");
}
#--------------------------------------------------
# actions for group-modify event
#--------------------------------------------------
$event = 'group-modify';
templates2events("/etc/httpd/conf/httpd.conf", $event);
safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
safe_touch("root/etc/e-smith/templates/etc/smb.conf/shares/template-begin");
safe_touch("root/var/service/rsyncd/down");
service_link_enhanced("rsyncd", "S95", "7");
service_link_enhanced("rsyncd", "K05", "6");
service_link_enhanced("rsyncd", "K05", "0");
safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/rsyncd');
safe_symlink("/var/service/rsyncd" , 'root/service/rsyncd');
templates2events("/etc/rsyncd.conf", "bootstrap-console-save");
templates2events("/etc/rsyncd.conf", "remoteaccess-update");
# for php-fpm
foreach my $service (qw(php-fpm php55-php-fpm php56-php-fpm php70-php-fpm php71-php-fpm php72-php-fpm php73-php-fpm php74-php-fpm php80-php-fpm php81-php-fpm)){
foreach my $event qw(share-create share-modify share-modify-server share-delete smeserver-shared-update){
safe_symlink("reload", "root/etc/e-smith/events/$event/services2adjust/$service");
}
}
foreach my $file qw( /etc/php-fpm.d/shares.conf
/opt/remi/php55/root/etc/php-fpm.d/shares.conf
/opt/remi/php56/root/etc/php-fpm.d/shares.conf
/etc/opt/remi/php70/php-fpm.d/shares.conf
/etc/opt/remi/php71/php-fpm.d/shares.conf
/etc/opt/remi/php72/php-fpm.d/shares.conf
/etc/opt/remi/php73/php-fpm.d/shares.conf
/etc/opt/remi/php74/php-fpm.d/shares.conf
/etc/opt/remi/php80/php-fpm.d/shares.conf
/etc/opt/remi/php81/php-fpm.d/shares.conf ){
templates2events($file, qw(webapps-update bootstrap-console-save share-create share-modify share-modify-server share-delete smeserver-shared-update smeserver-php-update));
safe_symlink('/etc/e-smith/templates-default/template-begin-ini', "root/etc/e-smith/templates$file/template-begin");
}
event_link("php-pool-dirs", "share-create", "90");
event_link("php-pool-dirs", "share-modify", "90");
event_link("php-pool-dirs", "share-modify-server", "90");
event_link("php-pool-dirs", "share-delete", "90");