From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [meta-oe][PATCH 1/2] mariadb: add systemd unit file
Date: Sun, 24 Aug 2014 22:25:26 -0700 [thread overview]
Message-ID: <20140825052525.GC1014@haswell> (raw)
In-Reply-To: <1408675054-4549-1-git-send-email-Qi.Chen@windriver.com>
On 14-08-22 10:37:33, Qi.Chen@windriver.com wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> The service file mainly comes from Fedora20.
>
> This patch also adds a configuration file under /etc/tmpfiles.d so
> that mysqld could start correctly.
the next patch for apache does the execdir replacement on install. Why
not here too ?
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
> .../recipes-support/mysql/mariadb/mysqld.service | 15 +++++++++++++++
> meta-oe/recipes-support/mysql/mariadb_5.5.38.inc | 19 +++++++++++++++++--
> 2 files changed, 32 insertions(+), 2 deletions(-)
> create mode 100644 meta-oe/recipes-support/mysql/mariadb/mysqld.service
>
> diff --git a/meta-oe/recipes-support/mysql/mariadb/mysqld.service b/meta-oe/recipes-support/mysql/mariadb/mysqld.service
> new file mode 100644
> index 0000000..698e52d
> --- /dev/null
> +++ b/meta-oe/recipes-support/mysql/mariadb/mysqld.service
> @@ -0,0 +1,15 @@
> +[Unit]
> +Description=MariaDB database server
> +After=syslog.target
> +After=network.target
> +
> +[Service]
> +Type=simple
> +User=mysql
> +Group=mysql
> +ExecStart=/usr/bin/mysqld_safe --basedir=/usr
> +TimeoutSec=300
> +PrivateTmp=true
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/meta-oe/recipes-support/mysql/mariadb_5.5.38.inc b/meta-oe/recipes-support/mysql/mariadb_5.5.38.inc
> index 8a73833..83f2a92 100644
> --- a/meta-oe/recipes-support/mysql/mariadb_5.5.38.inc
> +++ b/meta-oe/recipes-support/mysql/mariadb_5.5.38.inc
> @@ -9,6 +9,7 @@ SRC_URI = "http://mirror.stshosting.co.uk/mariadb/mariadb-${PV}/source/mariadb-$
> file://remove-bad-path.patch \
> file://fix-mysqlclient-r-version.patch \
> file://my.cnf \
> + file://mysqld.service \
> "
>
> SRC_URI[md5sum] = "fa9ba00b084b95a45fab70860c412f10"
> @@ -18,7 +19,7 @@ S = "${WORKDIR}/mariadb-${PV}"
>
> BINCONFIG_GLOB = "mysql_config"
>
> -inherit cmake gettext binconfig update-rc.d useradd
> +inherit cmake gettext binconfig update-rc.d useradd systemd
>
> INITSCRIPT_PACKAGES = "${PN}-server"
> INITSCRIPT_NAME = "mysqld"
> @@ -28,6 +29,10 @@ USERADD_PACKAGES = "${PN}-server"
> USERADD_PARAM_${PN}-server = "--system --home-dir /var/mysql -g mysql --shell /bin/false mysql"
> GROUPADD_PARAM_${PN}-server = "--system mysql"
>
> +SYSTEMD_PACKAGES = "mariadb-server"
> +SYSTEMD_SERVICE_mariadb-server = "mysqld.service"
> +SYSTEMD_AUTO_ENABLE_mariadb-server = "disable"
> +
> EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
>
> python __anonymous() {
> @@ -112,6 +117,15 @@ do_install() {
> install -d ${D}/${sysconfdir}/init.d
> install -m 0644 ${WORKDIR}/my.cnf ${D}/${sysconfdir}/
> mv ${D}/${sysconfdir}/init.d/mysql ${D}/${sysconfdir}/init.d/mysqld
> +
> + install -d ${D}${systemd_unitdir}/system
> + install -m 0644 ${WORKDIR}/mysqld.service ${D}${systemd_unitdir}/system
> +
> + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
> + install -d ${D}${sysconfdir}/tmpfiles.d
> + echo "f /var/log/mysqld.err 0640 mysql mysql -" \
> + > ${D}${sysconfdir}/tmpfiles.d/99-mysqld.conf
> + fi
> }
>
> pkg_postinst_${PN}-server () {
> @@ -247,7 +261,8 @@ FILES_${PN}-server = "\
> ${datadir}/mysql/ \
> ${localstatedir}/mysql/ \
> ${sysconfdir}/init.d \
> - ${sysconfdir}/my.cnf"
> + ${sysconfdir}/my.cnf \
> + ${sysconfdir}/tmpfiles.d"
>
> DESCRIPTION_${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}"
> FILES_${PN}-leftovers = "/"
> --
> 1.7.9.5
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
prev parent reply other threads:[~2014-08-25 5:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 2:37 [meta-oe][PATCH 1/2] mariadb: add systemd unit file Qi.Chen
2014-08-22 2:37 ` [meta-webserver][PATCH 2/2] apache2: " Qi.Chen
2014-08-25 5:25 ` Khem Raj [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140825052525.GC1014@haswell \
--to=raj.khem@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox