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

Proposed by Ignacio Nin on 2013-09-22
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) 2013-09-22 Needs Information on 2013-10-16
Ignacio Nin (community) Resubmit on 2013-09-30
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.
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
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: Resubmit
Alexey Kopytov (akopytov) wrote :

Same question as in the 5.1 MP.

review: Needs Information

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 on 2013-09-30

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 on 2013-09-30

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
1=== added file 'build/debian/percona-server-server-5.5.mysql.init'
2--- build/debian/percona-server-server-5.5.mysql.init 1970-01-01 00:00:00 +0000
3+++ build/debian/percona-server-server-5.5.mysql.init 2013-09-30 21:14:02 +0000
4@@ -0,0 +1,390 @@
5+#!/bin/sh
6+# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
7+# This file is public domain and comes with NO WARRANTY of any kind
8+
9+# MySQL (Percona Server) daemon start/stop script.
10+
11+# Usually this is put in /etc/init.d (at least on machines SYSV R4 based
12+# systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql.
13+# When this is done the mysql server will be started when the machine is
14+# started and shut down when the systems goes down.
15+
16+# Comments to support chkconfig on RedHat Linux
17+# chkconfig: 2345 64 36
18+# description: A very fast and reliable SQL database engine.
19+
20+# Comments to support LSB init script conventions
21+### BEGIN INIT INFO
22+# Provides: mysql
23+# Required-Start: $local_fs $network $remote_fs
24+# Should-Start: ypbind nscd ldap ntpd xntpd
25+# Required-Stop: $local_fs $network $remote_fs
26+# Default-Start: 2 3 4 5
27+# Default-Stop: 0 1 6
28+# Short-Description: start and stop MySQL (Percona Server)
29+# Description: Percona-Server is a SQL database engine with focus on high performance.
30+### END INIT INFO
31+
32+# If you install MySQL on some other places than /usr, then you
33+# have to do one of the following things for this script to work:
34+#
35+# - Run this script from within the MySQL installation directory
36+# - Create a /etc/my.cnf file with the following information:
37+# [mysqld]
38+# basedir=<path-to-mysql-installation-directory>
39+# - Add the above to any other configuration file (for example ~/.my.ini)
40+# and copy my_print_defaults to /usr/bin
41+# - Add the path to the mysql-installation-directory to the basedir variable
42+# below.
43+#
44+# If you want to affect other MySQL variables, you should make your changes
45+# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
46+
47+# If you change base dir, you must also change datadir. These may get
48+# overwritten by settings in the MySQL configuration files.
49+
50+basedir=
51+datadir=
52+
53+# Default value, in seconds, afterwhich the script should timeout waiting
54+# for server start.
55+# Value here is overriden by value in my.cnf.
56+# 0 means don't wait at all
57+# Negative numbers mean to wait indefinitely
58+service_startup_timeout=900
59+
60+# Lock directory for RedHat / SuSE.
61+lockdir='/var/lock/subsys'
62+lock_file_path="$lockdir/mysql"
63+
64+# The following variables are only set for letting mysql.server find things.
65+
66+# Set some defaults
67+mysqld_pid_file_path=
68+if test -z "$basedir"
69+then
70+ basedir=/usr
71+ bindir=/usr/bin
72+ if test -z "$datadir"
73+ then
74+ datadir=/var/lib/mysql
75+ fi
76+ sbindir=/usr/sbin
77+ libexecdir=/usr/sbin
78+else
79+ bindir="$basedir/bin"
80+ if test -z "$datadir"
81+ then
82+ datadir="$basedir/data"
83+ fi
84+ sbindir="$basedir/sbin"
85+ libexecdir="$basedir/libexec"
86+fi
87+
88+# datadir_set is used to determine if datadir was set (and so should be
89+# *not* set inside of the --basedir= handler.)
90+datadir_set=
91+
92+#
93+# Use LSB init script functions for printing messages, if possible
94+#
95+lsb_functions="/lib/lsb/init-functions"
96+if test -f $lsb_functions ; then
97+ . $lsb_functions
98+else
99+ log_success_msg()
100+ {
101+ echo " SUCCESS! $@"
102+ }
103+ log_failure_msg()
104+ {
105+ echo " ERROR! $@"
106+ }
107+fi
108+
109+PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"
110+export PATH
111+
112+mode=$1 # start or stop
113+
114+[ $# -ge 1 ] && shift
115+
116+
117+other_args="$*" # uncommon, but needed when called from an RPM upgrade action
118+ # Expected: "--skip-networking --skip-grant-tables"
119+ # They are not checked here, intentionally, as it is the resposibility
120+ # of the "spec" file author to give correct arguments only.
121+
122+case `echo "testing\c"`,`echo -n testing` in
123+ *c*,-n*) echo_n= echo_c= ;;
124+ *c*,*) echo_n=-n echo_c= ;;
125+ *) echo_n= echo_c='\c' ;;
126+esac
127+
128+parse_server_arguments() {
129+ for arg do
130+ case "$arg" in
131+ --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'`
132+ bindir="$basedir/bin"
133+ if test -z "$datadir_set"; then
134+ datadir="$basedir/data"
135+ fi
136+ sbindir="$basedir/sbin"
137+ libexecdir="$basedir/libexec"
138+ ;;
139+ --datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`
140+ datadir_set=1
141+ ;;
142+ --pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
143+ --service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
144+ esac
145+ done
146+}
147+
148+wait_for_pid () {
149+ verb="$1" # created | removed
150+ pid="$2" # process ID of the program operating on the pid-file
151+ pid_file_path="$3" # path to the PID file.
152+
153+ i=0
154+ avoid_race_condition="by checking again"
155+
156+ while test $i -ne $service_startup_timeout ; do
157+
158+ case "$verb" in
159+ 'created')
160+ # wait for a PID-file to pop into existence.
161+ test -s "$pid_file_path" && i='' && break
162+ ;;
163+ 'removed')
164+ # wait for this PID-file to disappear
165+ test ! -s "$pid_file_path" && i='' && break
166+ ;;
167+ *)
168+ echo "wait_for_pid () usage: wait_for_pid created|removed pid pid_file_path"
169+ exit 1
170+ ;;
171+ esac
172+
173+ # if server isn't running, then pid-file will never be updated
174+ if test -n "$pid"; then
175+ if kill -0 "$pid" 2>/dev/null; then
176+ : # the server still runs
177+ else
178+ # The server may have exited between the last pid-file check and now.
179+ if test -n "$avoid_race_condition"; then
180+ avoid_race_condition=""
181+ continue # Check again.
182+ fi
183+
184+ # there's nothing that will affect the file.
185+ log_failure_msg "The server quit without updating PID file ($pid_file_path)."
186+ return 1 # not waiting any more.
187+ fi
188+ fi
189+
190+ echo $echo_n ".$echo_c"
191+ i=`expr $i + 1`
192+ sleep 1
193+
194+ done
195+
196+ if test -z "$i" ; then
197+ log_success_msg
198+ return 0
199+ else
200+ log_failure_msg
201+ return 1
202+ fi
203+}
204+
205+# Get arguments from the my.cnf file,
206+# the only group, which is read from now on is [mysqld]
207+if test -x ./bin/my_print_defaults
208+then
209+ print_defaults="./bin/my_print_defaults"
210+elif test -x $bindir/my_print_defaults
211+then
212+ print_defaults="$bindir/my_print_defaults"
213+elif test -x $bindir/mysql_print_defaults
214+then
215+ print_defaults="$bindir/mysql_print_defaults"
216+else
217+ # Try to find basedir in /etc/my.cnf
218+ conf=/etc/my.cnf
219+ print_defaults=
220+ if test -r $conf
221+ then
222+ subpat='^[^=]*basedir[^=]*=\(.*\)$'
223+ dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
224+ for d in $dirs
225+ do
226+ d=`echo $d | sed -e 's/[ ]//g'`
227+ if test -x "$d/bin/my_print_defaults"
228+ then
229+ print_defaults="$d/bin/my_print_defaults"
230+ break
231+ fi
232+ if test -x "$d/bin/mysql_print_defaults"
233+ then
234+ print_defaults="$d/bin/mysql_print_defaults"
235+ break
236+ fi
237+ done
238+ fi
239+
240+ # Hope it's in the PATH ... but I doubt it
241+ test -z "$print_defaults" && print_defaults="my_print_defaults"
242+fi
243+
244+#
245+# Read defaults file from 'basedir'. If there is no defaults file there
246+# check if it's in the old (depricated) place (datadir) and read it from there
247+#
248+
249+extra_args=""
250+if test -r "$basedir/my.cnf"
251+then
252+ extra_args="-e $basedir/my.cnf"
253+else
254+ if test -r "$datadir/my.cnf"
255+ then
256+ extra_args="-e $datadir/my.cnf"
257+ fi
258+fi
259+
260+parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`
261+
262+#
263+# Set pid file if not given
264+#
265+if test -z "$mysqld_pid_file_path"
266+then
267+ mysqld_pid_file_path=$datadir/`hostname`.pid
268+else
269+ case "$mysqld_pid_file_path" in
270+ /* ) ;;
271+ * ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;;
272+ esac
273+fi
274+
275+case "$mode" in
276+ 'start')
277+ # Start daemon
278+
279+ # Safeguard (relative paths, core dumps..)
280+ cd $basedir
281+
282+ echo $echo_n "Starting MySQL (Percona Server)"
283+ if test -x $bindir/mysqld_safe
284+ then
285+ # Give extra arguments to mysqld with the my.cnf file. This script
286+ # may be overwritten at next upgrade.
287+ $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
288+ wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?
289+
290+ # Make lock for RedHat / SuSE
291+ if test -w "$lockdir"
292+ then
293+ touch "$lock_file_path"
294+ fi
295+
296+ exit $return_value
297+ else
298+ log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)"
299+ fi
300+ ;;
301+
302+ 'stop')
303+ # Stop daemon. We use a signal here to avoid having to know the
304+ # root password.
305+
306+ if test -s "$mysqld_pid_file_path"
307+ then
308+ mysqld_pid=`cat "$mysqld_pid_file_path"`
309+
310+ if (kill -0 $mysqld_pid 2>/dev/null)
311+ then
312+ echo $echo_n "Shutting down MySQL (Percona Server)"
313+ kill $mysqld_pid
314+ # mysqld should remove the pid file when it exits, so wait for it.
315+ wait_for_pid removed "$mysqld_pid" "$mysqld_pid_file_path"; return_value=$?
316+ else
317+ log_failure_msg "MySQL (Percona Server) server process #$mysqld_pid is not running!"
318+ rm "$mysqld_pid_file_path"
319+ fi
320+
321+ # Delete lock for RedHat / SuSE
322+ if test -f "$lock_file_path"
323+ then
324+ rm -f "$lock_file_path"
325+ fi
326+ exit $return_value
327+ else
328+ log_failure_msg "MySQL (Percona Server) PID file could not be found!"
329+ fi
330+ ;;
331+
332+ 'restart')
333+ # Stop the service and regardless of whether it was
334+ # running or not, start it again.
335+ if $0 stop $other_args; then
336+ $0 start $other_args
337+ else
338+ log_failure_msg "Failed to stop running server, so refusing to try to start."
339+ exit 1
340+ fi
341+ ;;
342+
343+ 'reload'|'force-reload')
344+ if test -s "$mysqld_pid_file_path" ; then
345+ read mysqld_pid < "$mysqld_pid_file_path"
346+ kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL (Percona Server)"
347+ touch "$mysqld_pid_file_path"
348+ else
349+ log_failure_msg "MySQL (Percona Server) PID file could not be found!"
350+ exit 1
351+ fi
352+ ;;
353+ 'status')
354+ # First, check to see if pid file exists
355+ if test -s "$mysqld_pid_file_path" ; then
356+ read mysqld_pid < "$mysqld_pid_file_path"
357+ if kill -0 $mysqld_pid 2>/dev/null ; then
358+ log_success_msg "MySQL (Percona Server) running ($mysqld_pid)"
359+ exit 0
360+ else
361+ log_failure_msg "MySQL (Percona Server) is not running, but PID file exists"
362+ exit 1
363+ fi
364+ else
365+ # Try to find appropriate mysqld process
366+ mysqld_pid=`pidof $libexecdir/mysqld`
367+
368+ # test if multiple pids exist
369+ pid_count=`echo $mysqld_pid | wc -w`
370+ if test $pid_count -gt 1 ; then
371+ log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)"
372+ exit 5
373+ elif test -z $mysqld_pid ; then
374+ if test -f "$lock_file_path" ; then
375+ log_failure_msg "MySQL (Percona Server) is not running, but lock file ($lock_file_path) exists"
376+ exit 2
377+ fi
378+ log_failure_msg "MySQL (Percona Server) is not running"
379+ exit 3
380+ else
381+ log_failure_msg "MySQL (Percona Server) is running but PID file could not be found"
382+ exit 4
383+ fi
384+ fi
385+ ;;
386+ *)
387+ # usage
388+ basename=`basename "$0"`
389+ echo "Usage: $basename {start|stop|restart|reload|force-reload|status} [ MySQL (Percona Server) options ]"
390+ exit 1
391+ ;;
392+esac
393+
394+exit 0
395
396=== removed file 'build/debian/percona-server-server-5.5.mysql.init'
397--- build/debian/percona-server-server-5.5.mysql.init 2012-09-18 04:57:16 +0000
398+++ build/debian/percona-server-server-5.5.mysql.init 1970-01-01 00:00:00 +0000
399@@ -1,184 +0,0 @@
400-#!/bin/bash
401-#
402-### BEGIN INIT INFO
403-# Provides: mysql
404-# Required-Start: $remote_fs $syslog
405-# Required-Stop: $remote_fs $syslog
406-# Should-Start: $network $named $time
407-# Should-Stop: $network $named $time
408-# Default-Start: 2 3 4 5
409-# Default-Stop: 0 1 6
410-# Short-Description: Start and stop the mysql (Percona Server) daemon
411-# Description: Controls the main MySQL (Percona Server) daemon "mysqld"
412-# and its wrapper script "mysqld_safe".
413-### END INIT INFO
414-#
415-set -e
416-set -u
417-${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
418-PERCONA_PREFIX=/usr
419-
420-test -x "${PERCONA_PREFIX}"/sbin/mysqld || exit 0
421-
422-. /lib/lsb/init-functions
423-
424-SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
425-CONF=/etc/mysql/my.cnf
426-MYADMIN="${PERCONA_PREFIX}/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
427-
428-# priority can be overriden and "-s" adds output to stderr
429-ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i"
430-
431-# Safeguard (relative paths, core dumps..)
432-cd /
433-umask 077
434-
435-# mysqladmin likes to read /root/.my.cnf. This is usually not what I want
436-# as many admins e.g. only store a password without a username there and
437-# so break my scripts.
438-export HOME=/etc/mysql/
439-
440-## Fetch a particular option from mysql's invocation.
441-#
442-# Usage: void mysqld_get_param option
443-mysqld_get_param() {
444- "${PERCONA_PREFIX}"/sbin/mysqld --print-defaults \
445- | tr " " "\n" \
446- | grep -- "--$1" \
447- | tail -n 1 \
448- | cut -d= -f2
449-}
450-
451-## Do some sanity checks before even trying to start mysqld.
452-sanity_checks() {
453- # check for config file
454- # DISABLED: We do not install my.cnf
455- #if [ ! -r /etc/mysql/my.cnf ]; then
456- # log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz"
457- # echo "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER
458- #fi
459-
460- # check for diskspace shortage
461- datadir=`mysqld_get_param datadir`
462- if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
463- log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
464- echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
465- exit 1
466- fi
467-}
468-
469-## Checks if there is a server running and if so if it is accessible.
470-#
471-# check_alive insists on a pingable server
472-# check_dead also fails if there is a lost mysqld in the process list
473-#
474-# Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn]
475-mysqld_status () {
476- ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))
477-
478- ps_alive=0
479- pidfile=`mysqld_get_param pid-file`
480- if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi
481-
482- if [ "$1" = "check_alive" -a $ping_alive = 1 ] ||
483- [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then
484- return 0 # EXIT_SUCCESS
485- else
486- if [ "$2" = "warn" ]; then
487- echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug
488- fi
489- return 1 # EXIT_FAILURE
490- fi
491-}
492-
493-#
494-# main()
495-#
496-
497-case "${1:-''}" in
498- 'start')
499- sanity_checks;
500- # Start daemon
501- log_daemon_msg "Starting MySQL (Percona Server) database server" "mysqld"
502- if mysqld_status check_alive nowarn; then
503- log_progress_msg "already running"
504- log_end_msg 0
505- else
506- "${PERCONA_PREFIX}"/bin/mysqld_safe > /dev/null 2>&1 &
507- # 6s was reported in #352070 to be too few when using ndbcluster
508- for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14; do
509- sleep 1
510- if mysqld_status check_alive nowarn ; then break; fi
511- log_progress_msg "."
512- done
513- if mysqld_status check_alive warn; then
514- log_end_msg 0
515- # Now start mysqlcheck or whatever the admin wants.
516- output=$(/etc/mysql/debian-start)
517- [ -n "$output" ] && log_action_msg "$output"
518- else
519- log_end_msg 1
520- log_failure_msg "Please take a look at the syslog"
521- fi
522- fi
523- ;;
524-
525- 'stop')
526- # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
527- # at least for cron, we can rely on it here, too. (although we have
528- # to specify it explicit as e.g. sudo environments points to the normal
529- # users home and not /root)
530- log_daemon_msg "Stopping MySQL (Percona Server)" "mysqld"
531- if ! mysqld_status check_dead nowarn; then
532- set +e
533- shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
534- set -e
535- if [ "$r" -ne 0 ]; then
536- log_end_msg 1
537- [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
538- log_daemon_msg "Killing MySQL (Percona Server) by signal" "mysqld"
539- killall -15 mysqld
540- server_down=
541- for i in 1 2 3 4 5 6 7 8 9 10; do
542- sleep 1
543- if mysqld_status check_dead nowarn; then server_down=1; break; fi
544- done
545- if test -z "$server_down"; then killall -9 mysqld; fi
546- fi
547- fi
548-
549- if ! mysqld_status check_dead warn; then
550- log_end_msg 1
551- log_failure_msg "Please stop MySQL (Percona Server) manually and read /usr/share/doc/percona-server-server-5.5/README.Debian.gz!"
552- exit -1
553- else
554- log_end_msg 0
555- fi
556- ;;
557-
558- 'restart')
559- set +e; $SELF stop; set -e
560- $SELF start
561- ;;
562-
563- 'reload'|'force-reload')
564- log_daemon_msg "Reloading MySQL (Percona Server)" "mysqld"
565- $MYADMIN reload
566- log_end_msg 0
567- ;;
568-
569- 'status')
570- if mysqld_status check_alive nowarn; then
571- log_action_msg "$($MYADMIN version)"
572- else
573- log_action_msg "MySQL (Percona Server) is stopped."
574- exit 3
575- fi
576- ;;
577-
578- *)
579- echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
580- exit 1
581- ;;
582-esac
583-
584
585=== modified file 'build/debian/percona-server-server-5.5.postinst'
586--- build/debian/percona-server-server-5.5.postinst 2013-02-19 07:01:26 +0000
587+++ build/debian/percona-server-server-5.5.postinst 2013-09-30 21:14:02 +0000
588@@ -58,7 +58,7 @@
589 # and because changed configuration options should take effect immediately.
590 # In case the server wasn't running at all it should be ok if the stop
591 # script fails. I can't tell at this point because of the cleaned /var/run.
592-set +e; invoke stop; set -e
593+set +e; invoke stop > /dev/null 2>&1; set -e
594
595 case "$1" in
596 configure)
597
598=== modified file 'build/debian/percona-server-server-5.5.postrm'
599--- build/debian/percona-server-server-5.5.postrm 2012-09-18 04:57:16 +0000
600+++ build/debian/percona-server-server-5.5.postrm 2013-09-30 21:14:02 +0000
601@@ -19,9 +19,13 @@
602 stop_server() {
603 set +e
604 if [ -x /usr/sbin/invoke-rc.d ]; then
605- invoke-rc.d percona-server stop
606+ cmd="invoke-rc.d mysql"
607 else
608- /etc/init.d/percona-server stop
609+ cmd="/etc/init.d/mysql"
610+ fi
611+ if $cmd status > /dev/null 2>&1
612+ then
613+ $cmd stop
614 fi
615 errno=$?
616 set -e
617@@ -69,7 +73,7 @@
618
619 # (normally) Automatically added by dh_installinit
620 if [ "$1" = "purge" ] ; then
621- update-rc.d percona-server remove >/dev/null || exit 0
622+ update-rc.d mysql remove >/dev/null || exit 0
623 fi
624 # (normally) End automatically added section
625 fi
626
627=== modified file 'build/debian/percona-server-server-5.5.preinst'
628--- build/debian/percona-server-server-5.5.preinst 2012-09-18 04:57:16 +0000
629+++ build/debian/percona-server-server-5.5.preinst 2013-09-30 21:14:02 +0000
630@@ -24,15 +24,18 @@
631 # do it himself. No database directories should be removed while the server
632 # is running! Another mysqld in e.g. a different chroot is fine for us.
633 stop_server() {
634- if [ ! -x /etc/init.d/percona-server ]; then return; fi
635+ if [ ! -x /etc/init.d/mysql ]; then return; fi
636
637 set +e
638 if [ -x /usr/sbin/invoke-rc.d ]; then
639- cmd="invoke-rc.d percona-server stop"
640+ cmd="invoke-rc.d mysql"
641 else
642- cmd="/etc/init.d/percona-server stop"
643- fi
644- $cmd
645+ cmd="/etc/init.d/mysql"
646+ fi
647+ if $cmd status > /dev/null 2>&1
648+ then
649+ $cmd stop
650+ fi
651 errno=$?
652 set -e
653

Subscribers

People subscribed via source and target branches