All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/2] mariadb: add systemd unit file
@ 2014-08-25  6:47 Qi.Chen
  2014-08-25  6:47 ` [PATCH V2 2/2] apache2: " Qi.Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Qi.Chen @ 2014-08-25  6:47 UTC (permalink / raw)
  To: openembedded-devel

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.

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   |   20 ++++++++++++++++++--
 2 files changed, 33 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..18ad8d5
--- /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=@BINDIR@/mysqld_safe --basedir=@PREFIX@
+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..4e9a9e5 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,16 @@ 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
+    sed -i -e 's,@BINDIR@,${bindir},g' -e 's,@PREFIX@,${prefix},g' ${D}${systemd_unitdir}/system/mysqld.service
+
+    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 +262,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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH V2 2/2] apache2: add systemd unit file
  2014-08-25  6:47 [PATCH V2 1/2] mariadb: add systemd unit file Qi.Chen
@ 2014-08-25  6:47 ` Qi.Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Qi.Chen @ 2014-08-25  6:47 UTC (permalink / raw)
  To: openembedded-devel

From: Chen Qi <Qi.Chen@windriver.com>

Add systemd unit file for apache2.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../recipes-httpd/apache2/apache2_2.4.10.bb        |   13 +++++++++++--
 .../recipes-httpd/apache2/files/apache2.service    |   14 ++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)
 create mode 100644 meta-webserver/recipes-httpd/apache2/files/apache2.service

diff --git a/meta-webserver/recipes-httpd/apache2/apache2_2.4.10.bb b/meta-webserver/recipes-httpd/apache2/apache2_2.4.10.bb
index 614dd4e..0356029 100644
--- a/meta-webserver/recipes-httpd/apache2/apache2_2.4.10.bb
+++ b/meta-webserver/recipes-httpd/apache2/apache2_2.4.10.bb
@@ -18,7 +18,8 @@ SRC_URI = "http://www.apache.org/dist/httpd/httpd-${PV}.tar.bz2 \
            file://npn-patch-2.4.7.patch \
            file://0001-configure-use-pkg-config-for-PCRE-detection.patch \
            file://init \
-           file://apache2-volatile.conf"
+           file://apache2-volatile.conf \
+           file://apache2.service"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
 SRC_URI[md5sum] = "44543dff14a4ebc1e9e2d86780507156"
@@ -26,7 +27,10 @@ SRC_URI[sha256sum] = "176c4dac1a745f07b7b91e7f4fd48f9c48049fa6f088efe758d61d9738
 
 S = "${WORKDIR}/httpd-${PV}"
 
-inherit autotools update-rc.d pkgconfig
+inherit autotools update-rc.d pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "apache2.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "disable"
 
 SSTATE_SCAN_FILES += "apxs config_vars.mk config.nice"
 
@@ -81,6 +85,11 @@ do_install_append() {
         install -d ${D}${sysconfdir}/tmpfiles.d/
         install -m 0644 ${WORKDIR}/apache2-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
     fi
+
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/apache2.service ${D}${systemd_unitdir}/system
+    sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apache2.service
+    sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/apache2.service
 }
 
 SYSROOT_PREPROCESS_FUNCS += "apache_sysroot_preprocess"
diff --git a/meta-webserver/recipes-httpd/apache2/files/apache2.service b/meta-webserver/recipes-httpd/apache2/files/apache2.service
new file mode 100644
index 0000000..f4bcf9e
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/files/apache2.service
@@ -0,0 +1,14 @@
+[Unit]
+Decription=The Apache HTTP Server
+After=network.target remote-fs.target nss-lookup.target
+
+[Service]
+Type=simple
+Environment=LANG=C
+ExecStart=@SBINDIR@/httpd -DFOREGROUND -D SSL -D PHP5 -k start
+ExecStop=@BASE_BINDIR@/kill -WINCH ${MAINPID}
+KillSignal=SIGCONT
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-25  6:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-25  6:47 [PATCH V2 1/2] mariadb: add systemd unit file Qi.Chen
2014-08-25  6:47 ` [PATCH V2 2/2] apache2: " Qi.Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.