/[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.4 - (show annotations) (download)
Tue Dec 8 19:57:09 2020 UTC (3 years, 5 months ago) by jpp
Branch: MAIN
CVS Tags: e-smith-mysql-2_6_0-22_el7_sme, e-smith-mysql-2_6_0-20_el7_sme, e-smith-mysql-2_6_0-17_el7_sme, e-smith-mysql-2_6_0-18_el7_sme, e-smith-mysql-2_6_0-19_el7_sme, e-smith-mysql-2_6_0-21_el7_sme, e-smith-mysql-2_6_0-15_el7_sme, e-smith-mysql-2_6_0-16_el7_sme, HEAD
Changes since 1.3: +2 -1 lines
* Mon Dec 07 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-15.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 and remove old /var/service/mariadb
- 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,43 @@
98 +[Unit]
99 +Description=MariaDB database server
100 +After=syslog.target
101 +After=network.target
102 +
103 +[Service]
104 +Type=simple
105 +User=root
106 +Group=root
107 +
108 +#reset
109 +ExecStartPre=
110 +#ours : we need root user as + and ! are not yet supported
111 +ExecStartPre=-/sbin/e-smith/service-status mariadb
112 +ExecStartPre=-/sbin/e-smith/expand-template /var/lib/mysql/set.password
113 +ExecStartPre=-/sbin/e-smith/expand-template /root/.my.cnf
114 +ExecStartPre=-/sbin/e-smith/expand-template /etc/my.cnf
115 +ExecStartPre=/sbin/e-smith/systemd/mariadb-initialize
116 +
117 +#reset
118 +ExecStart=
119 +#ours
120 +ExecStart=/usr/libexec/mysqld \
121 + --defaults-file=/etc/my.cnf \
122 + --basedir=/usr \
123 + --datadir=/var/lib/mysql \
124 + --user=mysql \
125 + --pid-file=/var/run/mariadb/mariadb.pid
126 +
127 +#reset
128 +ExecStartPost=
129 +#ours
130 +ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID
131 +
132 +# Give a reasonable amount of time for the server to start up/shut down
133 +TimeoutSec=300
134 +
135 +# Place temp files in a secure directory, not /tmp
136 +PrivateTmp=true
137 +
138 +[Install]
139 +WantedBy=sme-server.target
140 +

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