smeserver-BackupPC/createlinks

67 lines
2.4 KiB
Perl

#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
# Start and stop links - SME9
#service_link_enhanced("backuppc", "S98", "7");
#service_link_enhanced("backuppc", "K10", "6");
#service_link_enhanced("backuppc", "K10", "0");
#service_link_enhanced("backuppc", "K10", "1");
#service_link_enhanced("httpd-bkpc", "S86", "7");
#service_link_enhanced("httpd-bkpc", "K15", "6");
#service_link_enhanced("httpd-bkpc", "K15", "0");
#service_link_enhanced("httpd-bkpc", "K15", "1");
#safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/httpd-bkpc');
#safe_symlink("/var/service/httpd-bkpc" , 'root/service/httpd-bkpc');
# Panel links
panel_link("backuppc", 'manager');
# Various symlinks
# Event symlinks
# our event specific for updating with yum without reboot
$event = 'smeserver-BackupPC-update'; #Must match rpm name
foreach my $file (qw(/etc/systemd/system-preset/49-koozali.preset
/etc/httpd/conf/httpd.conf
/etc/sudoers
/etc/httpd/bkpc-conf/httpd.conf
/etc/updatedb.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("backuppc-checkupgrade", $event, "20");
event_link("backuppc-genkey", $event, "10");
event_link("backuppc-checkupgrade", "post-upgrade", "91");
event_link("backuppc-genkey", "post-upgrade", "90");
#services we need to restart
#safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/backuppc");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/httpd-bkpc");
safe_symlink("restart", "root/etc/e-smith/events/logrotate/services2adjust/httpd-bkpc");
# Create needed empty files
safe_touch("root/etc/e-smith/events/logrotate/logfiles2timestamp/var/log/httpd/bkpc_access_log");
safe_touch("root/etc/e-smith/events/logrotate/logfiles2timestamp/var/log/httpd/bkpc_error_log");
safe_touch("root/var/service/httpd-bkpc/down");
use esmith::Build::Backup qw(:all);
backup_includes("smeserver-BackupPC", qw(
/etc/BackupPC
));
# warning this could be a symlink to an external drive
# also this will not backup the whole backups, but who would do that by default ?
# /var/lib/BackupPC