SOURCES (AC-branch): mysql.init - try first graceful shutdown
(via...
Elan Ruusamäe
glen at delfi.ee
Fri Dec 17 19:35:54 CET 2004
does anybody has any objections, suggestions regarding that TODO
the issue is that it's complicated to do the user adding / renaming when there
are multiple clusters setup, and it makes more complicated if one of them is
down.
so maybe the trigger is not so important and new instances will be setup with
user mysqlctl, and for existing ones the failure of mysqladmin shutdown would
be ignored.
On Thursday 16 December 2004 00:48, glen wrote:
> Author: glen Date: Wed Dec 15 22:48:28 2004 GMT
> Module: SOURCES Tag: AC-branch
> ---- Log message:
> - try first graceful shutdown (via mysqladmin shutdown command)
> - typo
>
> ---- Files affected:
> SOURCES:
> mysql.init (1.70.2.2 -> 1.70.2.3)
>
> ---- Diffs:
>
> ================================================================
> Index: SOURCES/mysql.init
> diff -u SOURCES/mysql.init:1.70.2.2 SOURCES/mysql.init:1.70.2.3
> --- SOURCES/mysql.init:1.70.2.2 Wed Dec 15 21:27:32 2004
> +++ SOURCES/mysql.init Wed Dec 15 22:48:22 2004
> @@ -6,7 +6,6 @@
> #
> # description: A very fast and reliable SQL database engine.
> #
> -
> # Source function library
> . /etc/rc.d/init.d/functions
>
> @@ -208,6 +207,20 @@
> mysqlstatus "$clusterdir"
> msg_stopping "MySQL $clusterdir"
> busy
> +
> +# TODO
> +# graceful mysql shutdown with mysqladmin shutdown requires 'shutdown'
> +# privilege. create new user mysqlctl or rename mysql_logrotate to
> mysqlctl +# and give it both privs (flush-logs and shutdown)?
> +
> + # try graceful shutdown -- send shutdown command
> + /usr/bin/mysqladmin --defaults-file=$MYSQL_CONFIG
> ${MYSQL_SOCKET:+--socket=$MYSQL_SOCKET} shutdown + # 3 seconds
> + for nr in 1 2 3; do
> + [ -d "/proc/$MYSQL_PID" ] && sleep 1
> + done
> + mysqlstatus "$clusterdir"
> +
> [ "$MYSQL_PID" != "unknown" ] && kill -TERM "$MYSQL_PID" 2> /dev/null
> # 3 seconds
> for nr in 1 2 3; do
> @@ -221,6 +234,8 @@
> else
> ok
> fi
> +
> + # FIXME: should let mysqld remove pid by itself?
> rm -f "$MYSQL_PIDFILE"
> }
>
> @@ -495,7 +510,7 @@
> NOTE: mysql_logrotate password should be placed to $MYSQL_CONFIG in
> mysqladmin section. See the manual for more instructions.
>
> -IMPORTANT: The configuration file is mysqld.conf in MYSQ_DB_CLUSTERS
> directories. +IMPORTANT: The configuration file is mysqld.conf in
> MYSQL_DB_CLUSTERS directories.
>
> END_OF_MSG
> else
> ================================================================
>
> ---- CVS-web:
> http://cvs.pld-linux.org/SOURCES/mysql.init?r1=1.70.2.2&r2=1.70.2.3&f=u
>
>
> _______________________________________________
> pld-cvs-commit mailing list
> pld-cvs-commit at pld-linux.org
> http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
--
glen
More information about the pld-devel-en
mailing list