Page Menu
Home
Solus
Search
Configure Global Search
Log In
Files
F378
0002-Added-Files.patch
flippedBit (Ryan Rushton)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
flippedBit
Aug 7 2016, 5:24 AM
2016-08-07 05:24:45 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
0002-Added-Files.patch
View Options
From 21007ebe562c723e203c7675266ea5938c277e21 Mon Sep 17 00:00:00 2001
From: Ryan Rushton <rrushton@gmail.com>
Date: Sat, 6 Aug 2016 22:17:48 -0700
Subject: [PATCH 2/2] Added Files
---
files/mariadb-systemd-start | 34 ++++++++++++++++++++++++++++++++++
files/mariadb.service | 17 +++++++++++++++++
files/mysql-tmpfile.conf | 1 +
files/mysql.conf | 1 +
4 files changed, 53 insertions(+)
create mode 100644 files/mariadb-systemd-start
create mode 100644 files/mariadb.service
create mode 100644 files/mysql-tmpfile.conf
create mode 100644 files/mysql.conf
diff --git a/files/mariadb-systemd-start b/files/mariadb-systemd-start
new file mode 100644
index 0000000..9a840eb
--- /dev/null
+++ b/files/mariadb-systemd-start
@@ -0,0 +1,34 @@
+#! /bin/bash
+#
+# Scripts to run by MySQL systemd service
+#
+# Needed argument: pre | post
+#
+# pre mode : try to run mysql_install_db
+# post mode : ping server until answer is received and create socket directory
+#
+
+before () {
+ /usr/bin/mysql_install_db --user=mysql --datadir=/var/lib64/mysql --basedir=/usr
+ /bin/mkdir -p /run/mysqld
+ /bin/chown mysql:mysql -R /run/mysqld
+}
+
+after () {
+ # Wait for ping to answer to signal startup completed,
+ # might take a while in case of e.g. crash recovery
+ # MySQL systemd service will timeout script if no answer
+ while /bin/true ; do
+ sleep 1
+ mysqladmin ping >/dev/null 2>&1 && break
+ done
+ exit 0
+}
+
+# main
+case $1 in
+ "pre") before ;;
+ "post") after ;;
+esac
+
+exit 0
diff --git a/files/mariadb.service b/files/mariadb.service
new file mode 100644
index 0000000..96176c5
--- /dev/null
+++ b/files/mariadb.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=MariaDB database server
+After=syslog.target
+
+[Service]
+User=mysql
+Group=mysql
+PermissionsStartOnly=true
+ExecStartPre=/usr/bin/mariadb-systemd-start pre
+ExecStart=/usr/bin/mysqld_safe --pid-file=/run/mysqld/mysqld.pid --datadir=/var/lib64/mysql
+ExecStartPost=/usr/bin/mariadb-systemd-start post
+TimeoutSec=600
+Restart=always
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/files/mysql-tmpfile.conf b/files/mysql-tmpfile.conf
new file mode 100644
index 0000000..3318161
--- /dev/null
+++ b/files/mysql-tmpfile.conf
@@ -0,0 +1 @@
+d /var/lib64/mysql 0755 mysql mysql -
diff --git a/files/mysql.conf b/files/mysql.conf
new file mode 100644
index 0000000..5c0ce7f
--- /dev/null
+++ b/files/mysql.conf
@@ -0,0 +1 @@
+u mysql 130 - -
--
2.9.2
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
246
Default Alt Text
0002-Added-Files.patch (2 KB)
Attached To
Mode
T80: MariaDB
Attached
Detach File
Event Timeline
Log In to Comment