Merge lp:~ignacio-nin/percona-server/5.5-debian-init-script into lp:percona-server/5.5

Proposed by Ignacio Nin
Status: Work in progress
Proposed branch: lp:~ignacio-nin/percona-server/5.5-debian-init-script
Merge into: lp:percona-server/5.5
Diff against target: 652 lines (+16/-193)
4 files modified
build/debian/percona-server-server-5.5.mysql.init (+0/-184)
build/debian/percona-server-server-5.5.postinst (+1/-1)
build/debian/percona-server-server-5.5.postrm (+7/-3)
build/debian/percona-server-server-5.5.preinst (+8/-5)
To merge this branch: bzr merge lp:~ignacio-nin/percona-server/5.5-debian-init-script
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Needs Information
Ignacio Nin (community) Needs Resubmitting
Review via email: mp+186948@code.launchpad.net

Description of the change

New debian init script from the upstream package

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

- Comment for rev. 559 says file-id changes have been null-merged to 5.5, but I see that build/debian/percona-server-server-5.5.mysql.init still changes its file-id. Is that intentional?

- are there any specific bugs that this change is supposed to solve? If so, they should be referenced in comments/--fixes.

- the following change smells like a charset conversion issue:

658 - cp /usr/share/percona-server-common/internal-use-only/`echo $file | sed 's°/°_°g'` $file
659 + cp /usr/share/percona-server-common/internal-use-only/`echo $file | sed 's�/�_�g'` $file

review: Needs Fixing
Revision history for this message
Ignacio Nin (ignacio-nin) wrote :

> - Comment for rev. 559 says file-id changes have been null-merged to 5.5, but
> I see that build/debian/percona-server-server-5.5.mysql.init still changes its
> file-id. Is that intentional?

Yes, the file-id for this file is created new in 560, since it's a completely new file. 559 is indeed a null-merge.

>
> - are there any specific bugs that this change is supposed to solve? If so,
> they should be referenced in comments/--fixes.

Resubmitting with the same comments as for the 5.1 branch

>
> - the following change smells like a charset conversion issue:
>
> 658 - cp /usr/share/percona-server-common/internal-use-only/`echo $file |
> sed 's°/°_°g'` $file
> 659 + cp /usr/share/percona-server-common/internal-use-only/`echo $file |
> sed 's�/�_�g'` $file

Fix't-

review: Needs Resubmitting
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Same question as in the 5.1 MP.

review: Needs Information
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

The init script seems to be same as mysql.server.sh of centos.
Doesn't this require porting of some debian init script features?
For instance,

following is different in debian and centos:

# Required-Start: $local_fs $network $remote_fs
# Should-Start: ypbind nscd ldap ntpd xntpd
# Required-Stop: $local_fs $network $remote_fs

Unmerged revisions

560. By Ignacio Nin

Replace the debian init script with the script provided by source

The debian init script had some issues when it came to detecting the
server had been started -- it had a hardcoded 15 seconds wait (although
this could be overridden by my.cnf) and in order to detect a running
server it tried to login to it.

This came with issues when a) the startup time exceeded 15 seconds, which
is something that can easily happen with datasets of hundreds of gigs,
and b) if there was no user available for the init script to use, or the
user had been misconfigured somehow. Of course, these two possibilites
were true too often.

Replace the script with the one provided by MySQL, which uses a PID-file
based detection mechanism to check whether the server has been started or
stopped.

Given that the two init scripts share no common history (the previous one
came from the debian distribution), bzr rm and bzr add it to avoid
pointless conflicts. Merge this with the same fix for 5.1, and share the
file id with the corresponding file in that branch.

559. By Ignacio Nin

Unify the file-id's from the pre and post scripts for dpkg.

Null merge of this change in 5.1. Also introduce some local changes for
help with the merges.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'build/debian/percona-server-server-5.5.mysql.init'
--- build/debian/percona-server-server-5.5.mysql.init 1970-01-01 00:00:00 +0000
+++ build/debian/percona-server-server-5.5.mysql.init 2013-09-30 21:14:02 +0000
@@ -0,0 +1,390 @@
1#!/bin/sh
2# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
3# This file is public domain and comes with NO WARRANTY of any kind
4
5# MySQL (Percona Server) daemon start/stop script.
6
7# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
8# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
9# When this is done the mysql server will be started when the machine is
10# started and shut down when the systems goes down.
11
12# Comments to support chkconfig on RedHat Linux
13# chkconfig: 2345 64 36
14# description: A very fast and reliable SQL database engine.
15
16# Comments to support LSB init script conventions
17### BEGIN INIT INFO
18# Provides: mysql
19# Required-Start: $local_fs $network $remote_fs
20# Should-Start: ypbind nscd ldap ntpd xntpd
21# Required-Stop: $local_fs $network $remote_fs
22# Default-Start: 2 3 4 5
23# Default-Stop: 0 1 6
24# Short-Description: start and stop MySQL (Percona Server)
25# Description: Percona-Server is a SQL database engine with focus on high performance.
26### END INIT INFO
27
28# If you install MySQL on some other places than /usr, then you
29# have to do one of the following things for this script to work:
30#
31# - Run this script from within the MySQL installation directory
32# - Create a /etc/my.cnf file with the following information:
33# [mysqld]
34# basedir=<path-to-mysql-installation-directory>
35# - Add the above to any other configuration file (for example ~/.my.ini)
36# and copy my_print_defaults to /usr/bin
37# - Add the path to the mysql-installation-directory to the basedir variable
38# below.
39#
40# If you want to affect other MySQL variables, you should make your changes
41# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
42
43# If you change base dir, you must also change datadir. These may get
44# overwritten by settings in the MySQL configuration files.
45
46basedir=
47datadir=
48
49# Default value, in seconds, afterwhich the script should timeout waiting
50# for server start.
51# Value here is overriden by value in my.cnf.
52# 0 means don't wait at all
53# Negative numbers mean to wait indefinitely
54service_startup_timeout=900
55
56# Lock directory for RedHat / SuSE.
57lockdir='/var/lock/subsys'
58lock_file_path="$lockdir/mysql"
59
60# The following variables are only set for letting mysql.server find things.
61
62# Set some defaults
63mysqld_pid_file_path=
64if test -z "$basedir"
65then
66 basedir=/usr
67 bindir=/usr/bin
68 if test -z "$datadir"
69 then
70 datadir=/var/lib/mysql
71 fi
72 sbindir=/usr/sbin
73 libexecdir=/usr/sbin
74else
75 bindir="$basedir/bin"
76 if test -z "$datadir"
77 then
78 datadir="$basedir/data"
79 fi
80 sbindir="$basedir/sbin"
81 libexecdir="$basedir/libexec"
82fi
83
84# datadir_set is used to determine if datadir was set (and so should be
85# *not* set inside of the --basedir= handler.)
86datadir_set=
87
88#
89# Use LSB init script functions for printing messages, if possible
90#
91lsb_functions="/lib/lsb/init-functions"
92if test -f $lsb_functions ; then
93 . $lsb_functions
94else
95 log_success_msg()
96 {
97 echo " SUCCESS! $@"
98 }
99 log_failure_msg()
100 {
101 echo " ERROR! $@"
102 }
103fi
104
105PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"
106export PATH
107
108mode=$1 # start or stop
109
110[ $# -ge 1 ] && shift
111
112
113other_args="$*" # uncommon, but needed when called from an RPM upgrade action
114 # Expected: "--skip-networking --skip-grant-tables"
115 # They are not checked here, intentionally, as it is the resposibility
116 # of the "spec" file author to give correct arguments only.
117
118case `echo "testing\c"`,`echo -n testing` in
119 *c*,-n*) echo_n= echo_c= ;;
120 *c*,*) echo_n=-n echo_c= ;;
121 *) echo_n= echo_c='\c' ;;
122esac
123
124parse_server_arguments() {
125 for arg do
126 case "$arg" in
127 --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'`
128 bindir="$basedir/bin"
129 if test -z "$datadir_set"; then
130 datadir="$basedir/data"
131 fi
132 sbindir="$basedir/sbin"
133 libexecdir="$basedir/libexec"
134 ;;
135 --datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`
136 datadir_set=1
137 ;;
138 --pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
139 --service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
140 esac
141 done
142}
143
144wait_for_pid () {
145 verb="$1" # created | removed
146 pid="$2" # process ID of the program operating on the pid-file
147 pid_file_path="$3" # path to the PID file.
148
149 i=0
150 avoid_race_condition="by checking again"
151
152 while test $i -ne $service_startup_timeout ; do
153
154 case "$verb" in
155 'created')
156 # wait for a PID-file to pop into existence.
157 test -s "$pid_file_path" && i='' && break
158 ;;
159 'removed')
160 # wait for this PID-file to disappear
161 test ! -s "$pid_file_path" && i='' && break
162 ;;
163 *)
164 echo "wait_for_pid () usage: wait_for_pid created|removed pid pid_file_path"
165 exit 1
166 ;;
167 esac
168
169 # if server isn't running, then pid-file will never be updated
170 if test -n "$pid"; then
171 if kill -0 "$pid" 2>/dev/null; then
172 : # the server still runs
173 else
174 # The server may have exited between the last pid-file check and now.
175 if test -n "$avoid_race_condition"; then
176 avoid_race_condition=""
177 continue # Check again.
178 fi
179
180 # there's nothing that will affect the file.
181 log_failure_msg "The server quit without updating PID file ($pid_file_path)."
182 return 1 # not waiting any more.
183 fi
184 fi
185
186 echo $echo_n ".$echo_c"
187 i=`expr $i + 1`
188 sleep 1
189
190 done
191
192 if test -z "$i" ; then
193 log_success_msg
194 return 0
195 else
196 log_failure_msg
197 return 1
198 fi
199}
200
201# Get arguments from the my.cnf file,
202# the only group, which is read from now on is [mysqld]
203if test -x ./bin/my_print_defaults
204then
205 print_defaults="./bin/my_print_defaults"
206elif test -x $bindir/my_print_defaults
207then
208 print_defaults="$bindir/my_print_defaults"
209elif test -x $bindir/mysql_print_defaults
210then
211 print_defaults="$bindir/mysql_print_defaults"
212else
213 # Try to find basedir in /etc/my.cnf
214 conf=/etc/my.cnf
215 print_defaults=
216 if test -r $conf
217 then
218 subpat='^[^=]*basedir[^=]*=\(.*\)$'
219 dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
220 for d in $dirs
221 do
222 d=`echo $d | sed -e 's/[ ]//g'`
223 if test -x "$d/bin/my_print_defaults"
224 then
225 print_defaults="$d/bin/my_print_defaults"
226 break
227 fi
228 if test -x "$d/bin/mysql_print_defaults"
229 then
230 print_defaults="$d/bin/mysql_print_defaults"
231 break
232 fi
233 done
234 fi
235
236 # Hope it's in the PATH ... but I doubt it
237 test -z "$print_defaults" && print_defaults="my_print_defaults"
238fi
239
240#
241# Read defaults file from 'basedir'. If there is no defaults file there
242# check if it's in the old (depricated) place (datadir) and read it from there
243#
244
245extra_args=""
246if test -r "$basedir/my.cnf"
247then
248 extra_args="-e $basedir/my.cnf"
249else
250 if test -r "$datadir/my.cnf"
251 then
252 extra_args="-e $datadir/my.cnf"
253 fi
254fi
255
256parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`
257
258#
259# Set pid file if not given
260#
261if test -z "$mysqld_pid_file_path"
262then
263 mysqld_pid_file_path=$datadir/`hostname`.pid
264else
265 case "$mysqld_pid_file_path" in
266 /* ) ;;
267 * ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;;
268 esac
269fi
270
271case "$mode" in
272 'start')
273 # Start daemon
274
275 # Safeguard (relative paths, core dumps..)
276 cd $basedir
277
278 echo $echo_n "Starting MySQL (Percona Server)"
279 if test -x $bindir/mysqld_safe
280 then
281 # Give extra arguments to mysqld with the my.cnf file. This script
282 # may be overwritten at next upgrade.
283 $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
284 wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?
285
286 # Make lock for RedHat / SuSE
287 if test -w "$lockdir"
288 then
289 touch "$lock_file_path"
290 fi
291
292 exit $return_value
293 else
294 log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)"
295 fi
296 ;;
297
298 'stop')
299 # Stop daemon. We use a signal here to avoid having to know the
300 # root password.
301
302 if test -s "$mysqld_pid_file_path"
303 then
304 mysqld_pid=`cat "$mysqld_pid_file_path"`
305
306 if (kill -0 $mysqld_pid 2>/dev/null)
307 then
308 echo $echo_n "Shutting down MySQL (Percona Server)"
309 kill $mysqld_pid
310 # mysqld should remove the pid file when it exits, so wait for it.
311 wait_for_pid removed "$mysqld_pid" "$mysqld_pid_file_path"; return_value=$?
312 else
313 log_failure_msg "MySQL (Percona Server) server process #$mysqld_pid is not running!"
314 rm "$mysqld_pid_file_path"
315 fi
316
317 # Delete lock for RedHat / SuSE
318 if test -f "$lock_file_path"
319 then
320 rm -f "$lock_file_path"
321 fi
322 exit $return_value
323 else
324 log_failure_msg "MySQL (Percona Server) PID file could not be found!"
325 fi
326 ;;
327
328 'restart')
329 # Stop the service and regardless of whether it was
330 # running or not, start it again.
331 if $0 stop $other_args; then
332 $0 start $other_args
333 else
334 log_failure_msg "Failed to stop running server, so refusing to try to start."
335 exit 1
336 fi
337 ;;
338
339 'reload'|'force-reload')
340 if test -s "$mysqld_pid_file_path" ; then
341 read mysqld_pid < "$mysqld_pid_file_path"
342 kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL (Percona Server)"
343 touch "$mysqld_pid_file_path"
344 else
345 log_failure_msg "MySQL (Percona Server) PID file could not be found!"
346 exit 1
347 fi
348 ;;
349 'status')
350 # First, check to see if pid file exists
351 if test -s "$mysqld_pid_file_path" ; then
352 read mysqld_pid < "$mysqld_pid_file_path"
353 if kill -0 $mysqld_pid 2>/dev/null ; then
354 log_success_msg "MySQL (Percona Server) running ($mysqld_pid)"
355 exit 0
356 else
357 log_failure_msg "MySQL (Percona Server) is not running, but PID file exists"
358 exit 1
359 fi
360 else
361 # Try to find appropriate mysqld process
362 mysqld_pid=`pidof $libexecdir/mysqld`
363
364 # test if multiple pids exist
365 pid_count=`echo $mysqld_pid | wc -w`
366 if test $pid_count -gt 1 ; then
367 log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)"
368 exit 5
369 elif test -z $mysqld_pid ; then
370 if test -f "$lock_file_path" ; then
371 log_failure_msg "MySQL (Percona Server) is not running, but lock file ($lock_file_path) exists"
372 exit 2
373 fi
374 log_failure_msg "MySQL (Percona Server) is not running"
375 exit 3
376 else
377 log_failure_msg "MySQL (Percona Server) is running but PID file could not be found"
378 exit 4
379 fi
380 fi
381 ;;
382 *)
383 # usage
384 basename=`basename "$0"`
385 echo "Usage: $basename {start|stop|restart|reload|force-reload|status} [ MySQL (Percona Server) options ]"
386 exit 1
387 ;;
388esac
389
390exit 0
0391
=== removed file 'build/debian/percona-server-server-5.5.mysql.init'
--- build/debian/percona-server-server-5.5.mysql.init 2012-09-18 04:57:16 +0000
+++ build/debian/percona-server-server-5.5.mysql.init 1970-01-01 00:00:00 +0000
@@ -1,184 +0,0 @@
1#!/bin/bash
2#
3### BEGIN INIT INFO
4# Provides: mysql
5# Required-Start: $remote_fs $syslog
6# Required-Stop: $remote_fs $syslog
7# Should-Start: $network $named $time
8# Should-Stop: $network $named $time
9# Default-Start: 2 3 4 5
10# Default-Stop: 0 1 6
11# Short-Description: Start and stop the mysql (Percona Server) daemon
12# Description: Controls the main MySQL (Percona Server) daemon "mysqld"
13# and its wrapper script "mysqld_safe".
14### END INIT INFO
15#
16set -e
17set -u
18${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
19PERCONA_PREFIX=/usr
20
21test -x "${PERCONA_PREFIX}"/sbin/mysqld || exit 0
22
23. /lib/lsb/init-functions
24
25SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
26CONF=/etc/mysql/my.cnf
27MYADMIN="${PERCONA_PREFIX}/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
28
29# priority can be overriden and "-s" adds output to stderr
30ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i"
31
32# Safeguard (relative paths, core dumps..)
33cd /
34umask 077
35
36# mysqladmin likes to read /root/.my.cnf. This is usually not what I want
37# as many admins e.g. only store a password without a username there and
38# so break my scripts.
39export HOME=/etc/mysql/
40
41## Fetch a particular option from mysql's invocation.
42#
43# Usage: void mysqld_get_param option
44mysqld_get_param() {
45 "${PERCONA_PREFIX}"/sbin/mysqld --print-defaults \
46 | tr " " "\n" \
47 | grep -- "--$1" \
48 | tail -n 1 \
49 | cut -d= -f2
50}
51
52## Do some sanity checks before even trying to start mysqld.
53sanity_checks() {
54 # check for config file
55 # DISABLED: We do not install my.cnf
56 #if [ ! -r /etc/mysql/my.cnf ]; then
57 # log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz"
58 # echo "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER
59 #fi
60
61 # check for diskspace shortage
62 datadir=`mysqld_get_param datadir`
63 if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
64 log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
65 echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
66 exit 1
67 fi
68}
69
70## Checks if there is a server running and if so if it is accessible.
71#
72# check_alive insists on a pingable server
73# check_dead also fails if there is a lost mysqld in the process list
74#
75# Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn]
76mysqld_status () {
77 ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))
78
79 ps_alive=0
80 pidfile=`mysqld_get_param pid-file`
81 if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi
82
83 if [ "$1" = "check_alive" -a $ping_alive = 1 ] ||
84 [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then
85 return 0 # EXIT_SUCCESS
86 else
87 if [ "$2" = "warn" ]; then
88 echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug
89 fi
90 return 1 # EXIT_FAILURE
91 fi
92}
93
94#
95# main()
96#
97
98case "${1:-''}" in
99 'start')
100 sanity_checks;
101 # Start daemon
102 log_daemon_msg "Starting MySQL (Percona Server) database server" "mysqld"
103 if mysqld_status check_alive nowarn; then
104 log_progress_msg "already running"
105 log_end_msg 0
106 else
107 "${PERCONA_PREFIX}"/bin/mysqld_safe > /dev/null 2>&1 &
108 # 6s was reported in #352070 to be too few when using ndbcluster
109 for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; do
110 sleep 1
111 if mysqld_status check_alive nowarn ; then break; fi
112 log_progress_msg "."
113 done
114 if mysqld_status check_alive warn; then
115 log_end_msg 0
116 # Now start mysqlcheck or whatever the admin wants.
117 output=$(/etc/mysql/debian-start)
118 [ -n "$output" ] && log_action_msg "$output"
119 else
120 log_end_msg 1
121 log_failure_msg "Please take a look at the syslog"
122 fi
123 fi
124 ;;
125
126 'stop')
127 # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
128 # at least for cron, we can rely on it here, too. (although we have
129 # to specify it explicit as e.g. sudo environments points to the normal
130 # users home and not /root)
131 log_daemon_msg "Stopping MySQL (Percona Server)" "mysqld"
132 if ! mysqld_status check_dead nowarn; then
133 set +e
134 shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
135 set -e
136 if [ "$r" -ne 0 ]; then
137 log_end_msg 1
138 [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
139 log_daemon_msg "Killing MySQL (Percona Server) by signal" "mysqld"
140 killall -15 mysqld
141 server_down=
142 for i in 1 2 3 4 5 6 7 8 9 10; do
143 sleep 1
144 if mysqld_status check_dead nowarn; then server_down=1; break; fi
145 done
146 if test -z "$server_down"; then killall -9 mysqld; fi
147 fi
148 fi
149
150 if ! mysqld_status check_dead warn; then
151 log_end_msg 1
152 log_failure_msg "Please stop MySQL (Percona Server) manually and read /usr/share/doc/percona-server-server-5.5/README.Debian.gz!"
153 exit -1
154 else
155 log_end_msg 0
156 fi
157 ;;
158
159 'restart')
160 set +e; $SELF stop; set -e
161 $SELF start
162 ;;
163
164 'reload'|'force-reload')
165 log_daemon_msg "Reloading MySQL (Percona Server)" "mysqld"
166 $MYADMIN reload
167 log_end_msg 0
168 ;;
169
170 'status')
171 if mysqld_status check_alive nowarn; then
172 log_action_msg "$($MYADMIN version)"
173 else
174 log_action_msg "MySQL (Percona Server) is stopped."
175 exit 3
176 fi
177 ;;
178
179 *)
180 echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
181 exit 1
182 ;;
183esac
184
1850
=== modified file 'build/debian/percona-server-server-5.5.postinst'
--- build/debian/percona-server-server-5.5.postinst 2013-02-19 07:01:26 +0000
+++ build/debian/percona-server-server-5.5.postinst 2013-09-30 21:14:02 +0000
@@ -58,7 +58,7 @@
58# and because changed configuration options should take effect immediately.58# and because changed configuration options should take effect immediately.
59# In case the server wasn't running at all it should be ok if the stop59# In case the server wasn't running at all it should be ok if the stop
60# script fails. I can't tell at this point because of the cleaned /var/run.60# script fails. I can't tell at this point because of the cleaned /var/run.
61set +e; invoke stop; set -e61set +e; invoke stop > /dev/null 2>&1; set -e
62 62
63case "$1" in63case "$1" in
64 configure)64 configure)
6565
=== modified file 'build/debian/percona-server-server-5.5.postrm'
--- build/debian/percona-server-server-5.5.postrm 2012-09-18 04:57:16 +0000
+++ build/debian/percona-server-server-5.5.postrm 2013-09-30 21:14:02 +0000
@@ -19,9 +19,13 @@
19stop_server() {19stop_server() {
20 set +e20 set +e
21 if [ -x /usr/sbin/invoke-rc.d ]; then21 if [ -x /usr/sbin/invoke-rc.d ]; then
22 invoke-rc.d percona-server stop22 cmd="invoke-rc.d mysql"
23 else23 else
24 /etc/init.d/percona-server stop24 cmd="/etc/init.d/mysql"
25 fi
26 if $cmd status > /dev/null 2>&1
27 then
28 $cmd stop
25 fi29 fi
26 errno=$?30 errno=$?
27 set -e31 set -e
@@ -69,7 +73,7 @@
6973
70 # (normally) Automatically added by dh_installinit74 # (normally) Automatically added by dh_installinit
71 if [ "$1" = "purge" ] ; then75 if [ "$1" = "purge" ] ; then
72 update-rc.d percona-server remove >/dev/null || exit 076 update-rc.d mysql remove >/dev/null || exit 0
73 fi77 fi
74 # (normally) End automatically added section78 # (normally) End automatically added section
75fi79fi
7680
=== modified file 'build/debian/percona-server-server-5.5.preinst'
--- build/debian/percona-server-server-5.5.preinst 2012-09-18 04:57:16 +0000
+++ build/debian/percona-server-server-5.5.preinst 2013-09-30 21:14:02 +0000
@@ -24,15 +24,18 @@
24# do it himself. No database directories should be removed while the server24# do it himself. No database directories should be removed while the server
25# is running! Another mysqld in e.g. a different chroot is fine for us.25# is running! Another mysqld in e.g. a different chroot is fine for us.
26stop_server() {26stop_server() {
27 if [ ! -x /etc/init.d/percona-server ]; then return; fi27 if [ ! -x /etc/init.d/mysql ]; then return; fi
2828
29 set +e29 set +e
30 if [ -x /usr/sbin/invoke-rc.d ]; then30 if [ -x /usr/sbin/invoke-rc.d ]; then
31 cmd="invoke-rc.d percona-server stop"31 cmd="invoke-rc.d mysql"
32 else32 else
33 cmd="/etc/init.d/percona-server stop"33 cmd="/etc/init.d/mysql"
34 fi34 fi
35 $cmd35 if $cmd status > /dev/null 2>&1
36 then
37 $cmd stop
38 fi
36 errno=$?39 errno=$?
37 set -e40 set -e
38 41

Subscribers

People subscribed via source and target branches