/[smeserver]/rpms/e-smith-mysql/sme10/e-smith-mysql-2.6.0-bz11021-mariadb2systemd.patch
ViewVC logotype

Contents of /rpms/e-smith-mysql/sme10/e-smith-mysql-2.6.0-bz11021-mariadb2systemd.patch

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


Revision 1.1 - (show annotations) (download)
Tue Dec 8 03:26:23 2020 UTC (3 years, 10 months ago) by jpp
Branch: MAIN
* Mon Dec 07 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-14.sme
- e-smith-update event [SME: 11145]
- mariadb systemd integration [SME: 11021]
  move set.password and template
  create /usr/lib/systemd/system/mariadb.service.d/sme.conf
  create /sbin/e-smith/systemd/mariadb-initialize + chmod
  cleanup
- mysql.init systemd integration [SME: 11120]
  create mysql_init.service

1 diff -Nur e-smith-mysql-2.6.0.old/createlinks e-smith-mysql-2.6.0/createlinks
2 --- e-smith-mysql-2.6.0.old/createlinks 2020-12-07 21:55:44.804000000 -0500
3 +++ e-smith-mysql-2.6.0/createlinks 2020-12-07 22:15:38.989000000 -0500
4 @@ -33,7 +33,7 @@
5 foreach (qw(
6 /etc/my.cnf
7 /root/.my.cnf
8 - /var/service/mariadb/set.password
9 + /var/lib/mysql/set.password
10 ))
11 {
12 templates2events("$_", $event);
13 @@ -52,11 +52,6 @@
14 templates2events("/etc/e-smith/sql/init/10mysql_upgrade",
15 "bootstrap-console-save");
16
17 -safe_touch("root/var/service/mariadb/down");
18 -safe_symlink("/var/service/mariadb", "root/service/mariadb");
19 -safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/mariadb");
20 -service_link_enhanced("mariadb", 50, 7);
21 -
22 #--------------------------------------------------
23 # actions for e-smith-mysql-update event
24 #--------------------------------------------------
25 @@ -65,7 +60,7 @@
26 foreach (qw(
27 /etc/my.cnf
28 /root/.my.cnf
29 - /var/service/mariadb/set.password
30 + /var/lib/mysql/set.password
31 ))
32 {
33 templates2events("$_", $event);
34 diff -Nur e-smith-mysql-2.6.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password e-smith-mysql-2.6.0/root/etc/e-smith/templates/var/lib/mysql/set.password
35 --- e-smith-mysql-2.6.0.old/root/etc/e-smith/templates/var/lib/mysql/set.password 1969-12-31 19:00:00.000000000 -0500
36 +++ e-smith-mysql-2.6.0/root/etc/e-smith/templates/var/lib/mysql/set.password 2020-12-07 21:55:44.773000000 -0500
37 @@ -0,0 +1,11 @@
38 +{
39 + use esmith::util;
40 +
41 + my $pw = esmith::util::LdapPassword();
42 +
43 + $OUT .= "use mysql;\n";
44 + $OUT .= "ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n";
45 + $OUT .= "UPDATE user SET password=password('$pw') WHERE user='root';\n";
46 + $OUT .= "DELETE FROM user WHERE user='';\n";
47 + $OUT .= "FLUSH PRIVILEGES;\n";
48 +}
49 diff -Nur e-smith-mysql-2.6.0.old/root/etc/e-smith/templates/var/service/mariadb/set.password e-smith-mysql-2.6.0/root/etc/e-smith/templates/var/service/mariadb/set.password
50 --- e-smith-mysql-2.6.0.old/root/etc/e-smith/templates/var/service/mariadb/set.password 2020-12-07 21:55:44.773000000 -0500
51 +++ e-smith-mysql-2.6.0/root/etc/e-smith/templates/var/service/mariadb/set.password 1969-12-31 19:00:00.000000000 -0500
52 @@ -1,11 +0,0 @@
53 -{
54 - use esmith::util;
55 -
56 - my $pw = esmith::util::LdapPassword();
57 -
58 - $OUT .= "use mysql;\n";
59 - $OUT .= "ALTER TABLE user MODIFY Password char(41) NOT NULL default '';\n";
60 - $OUT .= "UPDATE user SET password=password('$pw') WHERE user='root';\n";
61 - $OUT .= "DELETE FROM user WHERE user='';\n";
62 - $OUT .= "FLUSH PRIVILEGES;\n";
63 -}
64 diff -Nur e-smith-mysql-2.6.0.old/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password e-smith-mysql-2.6.0/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password
65 --- e-smith-mysql-2.6.0.old/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password 1969-12-31 19:00:00.000000000 -0500
66 +++ e-smith-mysql-2.6.0/root/etc/e-smith/templates.metadata/var/lib/mysql/set.password 2020-12-07 22:07:30.287000000 -0500
67 @@ -0,0 +1,3 @@
68 +PERMS=0400
69 +UID="root"
70 +GID="root"
71 diff -Nur e-smith-mysql-2.6.0.old/root/etc/e-smith/templates.metadata/var/service/mariadb/set.password e-smith-mysql-2.6.0/root/etc/e-smith/templates.metadata/var/service/mariadb/set.password
72 --- e-smith-mysql-2.6.0.old/root/etc/e-smith/templates.metadata/var/service/mariadb/set.password 2020-12-07 21:55:44.773000000 -0500
73 +++ e-smith-mysql-2.6.0/root/etc/e-smith/templates.metadata/var/service/mariadb/set.password 1969-12-31 19:00:00.000000000 -0500
74 @@ -1 +0,0 @@
75 -PERMS=0400
76 diff -Nur e-smith-mysql-2.6.0.old/root/sbin/e-smith/systemd/mariadb-initialize e-smith-mysql-2.6.0/root/sbin/e-smith/systemd/mariadb-initialize
77 --- e-smith-mysql-2.6.0.old/root/sbin/e-smith/systemd/mariadb-initialize 1969-12-31 19:00:00.000000000 -0500
78 +++ e-smith-mysql-2.6.0/root/sbin/e-smith/systemd/mariadb-initialize 2020-12-07 22:03:28.381000000 -0500
79 @@ -0,0 +1,14 @@
80 +#! /bin/sh
81 +
82 +exec 2>&1
83 +if [ ! -f /var/lib/mysql/mysql/user.frm ]
84 +then
85 + setuidgid mysql sh /usr/bin/mysql_install_db
86 + /usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < /var/lib/mysql/set.password
87 + if [ -f /home/e-smith/db/mysql/mysql.dump ]
88 + then
89 + /sbin/e-smith/expand-template /etc/e-smith/sql/init/00_restore_dumped_dbs
90 + fi
91 +else
92 + /usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < /var/lib/mysql/set.password
93 +fi
94 diff -Nur e-smith-mysql-2.6.0.old/root/usr/lib/systemd/system/mariadb.service.d/50koozali.conf e-smith-mysql-2.6.0/root/usr/lib/systemd/system/mariadb.service.d/50koozali.conf
95 --- e-smith-mysql-2.6.0.old/root/usr/lib/systemd/system/mariadb.service.d/50koozali.conf 1969-12-31 19:00:00.000000000 -0500
96 +++ e-smith-mysql-2.6.0/root/usr/lib/systemd/system/mariadb.service.d/50koozali.conf 2020-12-07 21:59:46.298000000 -0500
97 @@ -0,0 +1,42 @@
98 +[Unit]
99 +Description=MariaDB database server
100 +After=syslog.target
101 +After=network.target
102 +
103 +[Service]
104 +Type=simple
105 +User=mysql
106 +Group=mysql
107 +
108 +#reset
109 +ExecStartPre=
110 +#ours
111 +ExecStartPre=/sbin/e-smith/expand-template /var/lib/mysql/set.password
112 +ExecStartPre=-/sbin/e-smith/expand-template /root/.my.cnf
113 +ExecStartPre=-/sbin/e-smith/expand-template /etc/my.cnf
114 +ExecStartPre=/sbin/e-smith/systemd/mariadb-initialize
115 +
116 +#reset
117 +ExecStart=
118 +#ours
119 +ExecStart=exec /usr/libexec/mysqld \
120 + --defaults-file=/etc/my.cnf \
121 + --basedir=/usr \
122 + --datadir=/var/lib/mysql \
123 + --user=mysql \
124 + --pid-file=/var/run/mariadb/mariadb.pid
125 +
126 +#reset
127 +ExecStartPost=
128 +#ours
129 +ExecStartPost=/usr/libexec/mariadb-wait-ready /var/run/mariadb/mariadb.pid
130 +
131 +# Give a reasonable amount of time for the server to start up/shut down
132 +TimeoutSec=300
133 +
134 +# Place temp files in a secure directory, not /tmp
135 +PrivateTmp=true
136 +
137 +[Install]
138 +WantedBy=sme-server.target
139 +

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