2024-03-23 06:06:28 +01:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
use esmith::Build::CreateLinks qw(:all);
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# pre-backup actions
|
|
|
|
#--------------------------------------------------
|
|
|
|
my $event = "pre-backup";
|
|
|
|
|
|
|
|
event_link("mysql-delete-dumped-tables", $event, "10");
|
|
|
|
event_link("mysql-dump-tables", $event, "20");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# post-backup actions
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "post-backup";
|
|
|
|
|
|
|
|
# Probably don't really need to do this
|
|
|
|
event_link("mysql-delete-dumped-tables", $event, "10");
|
|
|
|
|
|
|
|
# When we do a restore, we want to start from a completely clean slate
|
|
|
|
$event = "pre-restore";
|
|
|
|
|
|
|
|
safe_symlink("stop", "root/etc/e-smith/events/$event/services2adjust/mariadb");
|
|
|
|
# Needs to be after shutdown of mysqld
|
|
|
|
event_link("mysql-delete-db-files", $event, "99");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for bootstrap-console-save event
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "bootstrap-console-save";
|
|
|
|
|
|
|
|
foreach (qw(
|
|
|
|
/etc/my.cnf
|
|
|
|
/root/.my.cnf
|
2024-04-06 07:01:49 +02:00
|
|
|
/var/lib/mysql.private/set.password
|
2024-03-23 06:06:28 +01:00
|
|
|
))
|
|
|
|
{
|
|
|
|
templates2events("$_", $event);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Move all database dumps except for mysql.dump to sql/init
|
|
|
|
event_link("mysql-load-tables", $event, "40");
|
|
|
|
templates2events("/etc/e-smith/sql/init/10mysql_upgrade", $event);
|
|
|
|
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for timezone-update event
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "timezone-update";
|
|
|
|
|
|
|
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb");
|
|
|
|
|
|
|
|
#--------------------------------------------------
|
|
|
|
# actions for smeserver-mysql-update event
|
|
|
|
#--------------------------------------------------
|
|
|
|
$event = "smeserver-mysql-update";
|
|
|
|
|
|
|
|
foreach (qw(
|
|
|
|
/etc/my.cnf
|
|
|
|
/root/.my.cnf
|
2024-04-06 07:01:49 +02:00
|
|
|
/var/lib/mysql.private/set.password
|
2024-03-23 06:06:28 +01:00
|
|
|
))
|
|
|
|
{
|
|
|
|
templates2events("$_", $event);
|
|
|
|
}
|
|
|
|
|
|
|
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb");
|
|
|
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init");
|
|
|
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
|
|
|
|
# Move all database dumps except for mysql.dump to sql/init
|
|
|
|
event_link("mysql-load-tables", $event, "40");
|
|
|
|
templates2events("/etc/e-smith/sql/init/10mysql_upgrade", $event);
|
|
|
|
templates2events("/etc/rsyslog.conf", $event);
|
|
|
|
|
|
|
|
# systemd-specific action mandatory for this package-update event
|
|
|
|
event_link("systemd-reload", $event, "89");
|
|
|
|
event_link("systemd-default", $event, "88");
|
|
|
|
|
|
|
|
|