/[smecontribs]/rpms/smeserver-automysqlbackup/contribs10/smeserver-automysqlbackup-3.0.RC6-bz11970.update-cron.patch
ViewVC logotype

Annotation of /rpms/smeserver-automysqlbackup/contribs10/smeserver-automysqlbackup-3.0.RC6-bz11970.update-cron.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Wed Jun 8 11:55:27 2022 UTC (2 years, 5 months ago) by jcrisp
Branch: MAIN
CVS Tags: smeserver-automysqlbackup-3_0_RC6-30_el7_sme, smeserver-automysqlbackup-3_0_RC6-26_el7_sme, smeserver-automysqlbackup-3_0_RC6-27_el7_sme, smeserver-automysqlbackup-3_0_RC6-32_el7_sme, smeserver-automysqlbackup-3_0_RC6-24_el7_sme, smeserver-automysqlbackup-3_0_RC6-28_el7_sme, smeserver-automysqlbackup-3_0_RC6-31_el7_sme, smeserver-automysqlbackup-3_0_RC6-29_el7_sme, HEAD
* Tue Jun 07 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-24.sme
- Update cron [SME:11970]
- Fix SQL in Maria 105
- Remove automysql event and leave just smeserver-automysqlbackup-update
- Fix some createlinks
- Modify inits - but still leaves log errors if version not installed

1 jcrisp 1.1 diff -ruN smeserver-automysqlbackup-3.0.RC6.old/createlinks smeserver-automysqlbackup-3.0.RC6/createlinks
2     --- smeserver-automysqlbackup-3.0.RC6.old/createlinks 2022-06-08 09:34:57.638775325 +0100
3     +++ smeserver-automysqlbackup-3.0.RC6/createlinks 2022-06-08 10:57:53.238251378 +0100
4     @@ -17,11 +17,15 @@
5     /etc/automysqlbackup/mymaria103.conf
6     /etc/automysqlbackup/mymaria105.conf
7     /etc/e-smith/sql/init/automysqlbackup
8     + /etc/e-smith/sql/init57/automysqlbackup
9     + /etc/e-smith/sql/init101/automysqlbackup
10     + /etc/e-smith/sql/init102/automysqlbackup
11     + /etc/e-smith/sql/init103/automysqlbackup
12     + /etc/e-smith/sql/init105/automysqlbackup
13     ))
14     {
15     templates2events(
16     "$_", qw(
17     - automysqlbackup-update
18     smeserver-automysqlbackup-update
19     console-save
20     bootstrap-console-save
21     @@ -29,16 +33,22 @@
22     );
23     }
24    
25     +# Not required I think
26     +
27     # add action /etc/e-smith/events/actions/automysqlbackup to automysqlbackup-update bootstrap-console-save
28     -foreach my $event (qw( automysqlbackup-update
29     - smeserver-automysqlbackup-update
30     - bootstrap-console-save)){
31     - event_link("automysqlbackup", $event, "15");
32     -}
33     +#foreach my $event (qw( smeserver-automysqlbackup-update
34     +# bootstrap-console-save))
35     +# {
36     +# event_link("automysqlbackup", $event, "15");
37     +#}
38    
39     # add mysql.init restart to automysqlbackup-update
40     -for my $event (qw( automysqlbackup-update
41     - smeserver-automysqlbackup-update
42     -)){
43     -safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init");;
44     +foreach my $event (qw( smeserver-automysqlbackup-update))
45     + {
46     + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysql.init");
47     + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb57-mysql.init");
48     + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb101-mysql.init");
49     + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb102-mysql.init");
50     + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb103-mysql.init");
51     + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mariadb105-mysql.init");
52     }
53     diff -ruN smeserver-automysqlbackup-3.0.RC6.old/root/etc/e-smith/templates/etc/cron.d/runmysqlbackup/10base smeserver-automysqlbackup-3.0.RC6/root/etc/e-smith/templates/etc/cron.d/runmysqlbackup/10base
54     --- smeserver-automysqlbackup-3.0.RC6.old/root/etc/e-smith/templates/etc/cron.d/runmysqlbackup/10base 2022-06-08 09:34:57.633775242 +0100
55     +++ smeserver-automysqlbackup-3.0.RC6/root/etc/e-smith/templates/etc/cron.d/runmysqlbackup/10base 2022-06-08 10:53:44.124128960 +0100
56     @@ -1,22 +1,31 @@
57     {
58     -my $my51 = ${'mysqld'}{'status'} || 'disabled';
59     -$my51 = ( ( ( ${'automysqlbackup'}{'Mysql51'} || 'enabled' ) eq "enabled" ) and ( $my51 eq "enabled" ) ) ? "enabled" : "disabled";
60     -my $my55 = ${'mysql55-mysqld'}{'status'} || 'disabled';
61     -$my55 = ( ( ( ${'automysqlbackup'}{'Mysql55'} || 'enabled' ) eq "enabled" ) and ( $my55 eq "enabled" ) ) ? "enabled" : "disabled";
62     -my $my57 = ${'mysql57-mysqld'}{'status'} || 'disabled';
63     -$my57 = ( ( ( ${'automysqlbackup'}{'Mysql57'} || 'enabled' ) eq "enabled" ) and ( $my57 eq "enabled" ) ) ? "enabled" : "disabled";
64     +
65     my $mymaria = ${'mariadb'}{'status'} || 'disabled';
66     $mymaria = ( ( ( ${'automysqlbackup'}{'Mymaria'} || 'enabled' ) eq "enabled" ) and ( $mymaria eq "enabled") ) ? "enabled" : "disabled";
67     +my $my57 = ${'mysql57-mysqld'}{'status'} || 'disabled';
68     +$my57 = ( ( ( ${'automysqlbackup'}{'Mysql57'} || 'enabled' ) eq "enabled" ) and ( $my57 eq "enabled" ) ) ? "enabled" : "disabled";
69     +
70     +my $my101 = ${'mariadb101-mariadb'}{'status'} || 'disabled';
71     +$my101 = ( ( ( ${'automysqlbackup'}{'Mymaria101'} || 'enabled' ) eq "enabled" ) and ( $my101 eq "enabled" ) ) ? "enabled" : "disabled";
72     +my $my102 = ${'mariadb102-mariadb'}{'status'} || 'disabled';
73     +$my102 = ( ( ( ${'automysqlbackup'}{'Mymaria102'} || 'enabled' ) eq "enabled" ) and ( $my102 eq "enabled" ) ) ? "enabled" : "disabled";
74     +my $my103 = ${'mariadb103-mariadb'}{'status'} || 'disabled';
75     +$my103 = ( ( ( ${'automysqlbackup'}{'Mymaria101'} || 'enabled' ) eq "enabled" ) and ( $my103 eq "enabled" ) ) ? "enabled" : "disabled";
76     +my $my105 = ${'mariadb105-mariadb'}{'status'} || 'disabled';
77     +$my105 = ( ( ( ${'automysqlbackup'}{'Mymaria105'} || 'enabled' ) eq "enabled" ) and ( $my105 eq "enabled" ) ) ? "enabled" : "disabled";
78     +
79     +#return '' unless $mymymaria eq 'enabled';
80    
81     -#return '' unless $my51 eq 'enabled';
82     my $minutes= ${'automysqlbackup'}{'Minute'}||'1';
83     my $hours= ${'automysqlbackup'}{'Hour'}||'3';
84     $OUT = "$minutes $hours * * * root ";
85    
86     -$OUT .= "/sbin/e-smith/runmysqlbackup /etc/automysqlbackup/myserver.conf ' ' > /dev/null ; " if $my51 eq "enabled";
87     -$OUT .= "/sbin/e-smith/runmysqlbackup /etc/automysqlbackup/mysql55.conf '_mysql55' > /dev/null ; " if $my55 eq "enabled";
88     -$OUT .= "/sbin/e-smith/runmysqlbackup /etc/automysqlbackup/mysql57.conf '_mysql57' > /dev/null ; " if $my57 eq "enabled";
89     $OUT .= "/sbin/e-smith/runmysqlbackup /etc/automysqlbackup/mymaria.conf '_mymaria' > /dev/null ; " if $mymaria eq "enabled";
90     +$OUT .= "/sbin/e-smith/runmysqlbackup /etc/automysqlbackup/mysql57.conf '_mysql57' > /dev/null ; " if $my57 eq "enabled";
91     +$OUT .= "/sbin/e-smith/runmysqlbackup /etc/automysqlbackup/mymaria101.conf '_mysql101' > /dev/null ; " if $my101 eq "enabled";
92     +$OUT .= "/sbin/e-smith/runmysqlbackup /etc/automysqlbackup/mymaria102.conf '_mysql102' > /dev/null ; " if $my102 eq "enabled";
93     +$OUT .= "/sbin/e-smith/runmysqlbackup /etc/automysqlbackup/mymaria103.conf '_mysql103' > /dev/null ; " if $my103 eq "enabled";
94     +$OUT .= "/sbin/e-smith/runmysqlbackup /etc/automysqlbackup/mymaria105.conf '_mysql105' > /dev/null ; " if $my105 eq "enabled";
95    
96     $OUT .= "\n";
97    
98     diff -ruN smeserver-automysqlbackup-3.0.RC6.old/root/etc/e-smith/templates/etc/e-smith/sql/init105/automysqlbackup smeserver-automysqlbackup-3.0.RC6/root/etc/e-smith/templates/etc/e-smith/sql/init105/automysqlbackup
99     --- smeserver-automysqlbackup-3.0.RC6.old/root/etc/e-smith/templates/etc/e-smith/sql/init105/automysqlbackup 2022-06-08 09:34:57.634775259 +0100
100     +++ smeserver-automysqlbackup-3.0.RC6/root/etc/e-smith/templates/etc/e-smith/sql/init105/automysqlbackup 2022-06-08 10:53:44.124128960 +0100
101     @@ -13,27 +13,13 @@
102     /opt/rh/rh-mariadb105/root/usr/bin/mysql --socket=/var/lib/mysql/mariadb105.sock <<EOF
103     USE mysql;
104    
105     -REPLACE INTO user (
106     - host,
107     - user,
108     - authentication_string,
109     - ssl_cipher,
110     - x509_issuer,
111     - x509_subject)
112     - VALUES (
113     - 'localhost',
114     - '$user',
115     - PASSWORD ('$pass'),
116     - '',
117     - '',
118     - '');
119     -
120     -
121     +DROP USER IF EXISTS 'backupuser\@localhost';
122     +DROP USER IF EXISTS '$user\@localhost';
123     +CREATE USER IF NOT EXISTS '$user'\@'localhost' IDENTIFIED BY '$pass';
124     REVOKE ALL PRIVILEGES ON *.* FROM '$user'\@'localhost';
125     REVOKE GRANT OPTION ON *.* FROM '$user'\@'localhost';
126     GRANT EVENT,SELECT,LOCK TABLES, SHOW VIEW ON *.* TO '$user'\@'localhost' ;
127    
128     -
129     FLUSH PRIVILEGES;
130     EOF
131     END
132     diff -ruN smeserver-automysqlbackup-3.0.RC6.old/root/etc/e-smith/templates/etc/e-smith/sql/init55/automysqlbackup smeserver-automysqlbackup-3.0.RC6/root/etc/e-smith/templates/etc/e-smith/sql/init55/automysqlbackup
133     --- smeserver-automysqlbackup-3.0.RC6.old/root/etc/e-smith/templates/etc/e-smith/sql/init55/automysqlbackup 2022-06-08 09:34:57.634775259 +0100
134     +++ smeserver-automysqlbackup-3.0.RC6/root/etc/e-smith/templates/etc/e-smith/sql/init55/automysqlbackup 1970-01-01 01:00:00.000000000 +0100
135     @@ -1,37 +0,0 @@
136     -{
137     -my $user = $automysqlbackup{'DbUser'} || 'backupuser';
138     -my $pass = $automysqlbackup{'DbPassword'} || 'automysqlbackup';
139     -my $status = ${'mysqld'}{'status'} || 'disabled';
140     -
141     -$OUT = "#! /bin/sh
142     -";
143     -
144     -if ( "$status" eq "enabled" ) {
145     -
146     -$OUT .= <<"END";
147     -HOME="/root/";
148     -/usr/bin/mysql --socket=/var/lib/mysql/mysql.sock <<EOF
149     -USE mysql;
150     -
151     -REPLACE INTO user (
152     - host,
153     - user,
154     - password)
155     - VALUES (
156     - 'localhost',
157     - '$user',
158     - PASSWORD ('$pass'));
159     -
160     -
161     -REVOKE ALL PRIVILEGES ON *.* FROM '$user'\@'localhost';
162     -REVOKE GRANT OPTION ON *.* FROM '$user'\@'localhost';
163     -GRANT EVENT,SELECT,LOCK TABLES, SHOW VIEW ON *.* TO '$user'\@'localhost' ;
164     -
165     -
166     -FLUSH PRIVILEGES;
167     -EOF
168     -END
169     -}
170     -
171     -}
172     -

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed