Gentoo Archives: gentoo-commits

From: "Brian Evans (grknight)" <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-db/mysql-init-scripts/files: run-s6 init.d-s6 log-s6
Date: Wed, 27 May 2015 21:01:09
Message-Id: 20150527210103.5134EA0D@oystercatcher.gentoo.org
1 grknight 15/05/27 21:01:03
2
3 Modified: run-s6 init.d-s6 log-s6
4 Log:
5 Version bump to correct s6 support for dependencies and sourcing
6
7 (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key D1F781EFF9F4A3B6)
8
9 Revision Changes Path
10 1.2 dev-db/mysql-init-scripts/files/run-s6
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/mysql-init-scripts/files/run-s6?rev=1.2&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/mysql-init-scripts/files/run-s6?rev=1.2&content-type=text/plain
14 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/mysql-init-scripts/files/run-s6?r1=1.1&r2=1.2
15
16 Index: run-s6
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/run-s6,v
19 retrieving revision 1.1
20 retrieving revision 1.2
21 diff -u -r1.1 -r1.2
22 --- run-s6 27 May 2015 17:02:26 -0000 1.1
23 +++ run-s6 27 May 2015 21:01:03 -0000 1.2
24 @@ -1,18 +1,7 @@
25 #!/bin/sh
26 # Copyright 1999-2015 Gentoo Foundation
27 # Distributed under the terms of the GNU General Public License v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/run-s6,v 1.1 2015/05/27 17:02:26 grknight Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/run-s6,v 1.2 2015/05/27 21:01:03 grknight Exp $
30
31 -get_config() {
32 - my_print_defaults --config-file="$1" mysqld |
33 - sed -n -e "s/^--$2=//p"
34 -}
35 -
36 -SVCNAME=$(cd `dirname $0` && pwd | awk -F/ '{ print $NF }' )
37 -
38 -source "${ROOT:-/}etc/conf.d/${SVCNAME}"
39 -
40 -MY_CNF="${MY_CNF:-/etc/${SVCNAME}/my.cnf}"
41 -
42 -basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
43 -exec "${basedir}"/sbin/mysqld --defaults-file="${MY_CNF}" ${MY_ARGS} 2>&1
44 +if [ -e ./env ] ; then source ./env ; else echo "failed to source env" ; fi
45 +exec "${basedir}/sbin/mysqld" --defaults-file="${MY_CNF}" ${MY_ARGS} 2>&1
46
47
48
49 1.2 dev-db/mysql-init-scripts/files/init.d-s6
50
51 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/mysql-init-scripts/files/init.d-s6?rev=1.2&view=markup
52 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/mysql-init-scripts/files/init.d-s6?rev=1.2&content-type=text/plain
53 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/mysql-init-scripts/files/init.d-s6?r1=1.1&r2=1.2
54
55 Index: init.d-s6
56 ===================================================================
57 RCS file: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/init.d-s6,v
58 retrieving revision 1.1
59 retrieving revision 1.2
60 diff -u -r1.1 -r1.2
61 --- init.d-s6 27 May 2015 17:02:26 -0000 1.1
62 +++ init.d-s6 27 May 2015 21:01:03 -0000 1.2
63 @@ -1,7 +1,7 @@
64 #!/sbin/openrc-run
65 # Copyright 1999-2015 Gentoo Foundation
66 # Distributed under the terms of the GNU General Public License v2
67 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/init.d-s6,v 1.1 2015/05/27 17:02:26 grknight Exp $
68 +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/init.d-s6,v 1.2 2015/05/27 21:01:03 grknight Exp $
69
70 depend() {
71 use net.lo
72 @@ -41,6 +41,7 @@
73 fi
74
75 # tail -n1 is critical as these we only want the last instance of the option
76 + local basedir=$(get_config "${MY_CNF}" basedir | tail -n1)
77 local datadir=$(get_config "${MY_CNF}" datadir | tail -n1)
78 local pidfile=$(get_config "${MY_CNF}" pid-file | tail -n1)
79 local socket=$(get_config "${MY_CNF}" socket | tail -n1)
80 @@ -77,6 +78,14 @@
81 eerror "Directory $piddir for pidfile does not exist and cannot be created"
82 return 1
83 fi
84 +
85 + # Prepare env files to source
86 + mkdir -p "/var/svc.d/${SVCNAME}"
87 + echo "MY_CNF=\"${MY_CNF}\"" > "/var/svc.d/${SVCNAME}/env"
88 + echo "MY_ARGS=\"${MY_ARGS}\"" >> "/var/svc.d/${SVCNAME}/env"
89 + echo "basedir=\"${basedir}\"" >> "/var/svc.d/${SVCNAME}/env"
90 + mkdir -p "/var/svc.d/${SVCNAME}/log"
91 + echo "SVCNAME=\"${SVCNAME}\"" > "/var/svc.d/${SVCNAME}/log/env"
92 }
93
94 start_post() {
95
96
97
98 1.2 dev-db/mysql-init-scripts/files/log-s6
99
100 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/mysql-init-scripts/files/log-s6?rev=1.2&view=markup
101 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/mysql-init-scripts/files/log-s6?rev=1.2&content-type=text/plain
102 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/mysql-init-scripts/files/log-s6?r1=1.1&r2=1.2
103
104 Index: log-s6
105 ===================================================================
106 RCS file: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/log-s6,v
107 retrieving revision 1.1
108 retrieving revision 1.2
109 diff -u -r1.1 -r1.2
110 --- log-s6 27 May 2015 17:02:26 -0000 1.1
111 +++ log-s6 27 May 2015 21:01:03 -0000 1.2
112 @@ -1,9 +1,9 @@
113 #!/bin/sh
114 # Copyright 1999-2015 Gentoo Foundation
115 # Distributed under the terms of the GNU General Public License v2
116 -# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/log-s6,v 1.1 2015/05/27 17:02:26 grknight Exp $
117 +# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/log-s6,v 1.2 2015/05/27 21:01:03 grknight Exp $
118
119 -SVCNAME=$(cd `dirname $0` && pwd | awk -F/ '{ print $--NF }' )
120 +if [ -e ./env ] ; then source ./env ; else echo "failed to source env" ; fi
121 mkdir -p "/var/log/mysql/${SVCNAME}"
122 if [ ${S6_LOG_OPTIONS} ] ; then
123 exec s6-log ${S6_LOG_OPTIONS}