From 9eeffbcbf876a4ee058d8cedfb6ce956696494ee Mon Sep 17 00:00:00 2001 From: Dirk Froemberg Date: Sun, 10 Nov 2002 20:24:24 +0000 Subject: Only kill mysqld we started. Don't kill all mysqld. Submitted by: sobomax (modified by me a bit) --- databases/mysql323-server/Makefile | 4 ++-- databases/mysql323-server/files/mysql-server.sh | 11 +++++++++-- databases/mysql40-server/Makefile | 4 ++-- databases/mysql40-server/files/mysql-server.sh | 11 +++++++++-- databases/mysql41-server/Makefile | 4 ++-- databases/mysql41-server/files/mysql-server.sh | 11 +++++++++-- databases/mysql50-server/Makefile | 4 ++-- databases/mysql50-server/files/mysql-server.sh | 11 +++++++++-- databases/mysql51-server/Makefile | 4 ++-- databases/mysql51-server/files/mysql-server.sh | 11 +++++++++-- databases/mysql54-server/Makefile | 4 ++-- databases/mysql54-server/files/mysql-server.sh | 11 +++++++++-- databases/mysql55-server/Makefile | 4 ++-- databases/mysql55-server/files/mysql-server.sh | 11 +++++++++-- databases/mysql60-server/Makefile | 4 ++-- databases/mysql60-server/files/mysql-server.sh | 11 +++++++++-- databases/percona55-server/Makefile | 4 ++-- databases/percona55-server/files/mysql-server.sh | 11 +++++++++-- 18 files changed, 99 insertions(+), 36 deletions(-) (limited to 'databases') diff --git a/databases/mysql323-server/Makefile b/databases/mysql323-server/Makefile index fa666aeab4b7..5011bb848da1 100644 --- a/databases/mysql323-server/Makefile +++ b/databases/mysql323-server/Makefile @@ -7,7 +7,7 @@ PORTNAME?= ${MASTERPORTNAME} PORTVERSION= 3.23.53 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ http://www.kernelnotes.de/MySQL/Downloads/MySQL-3.23/ \ @@ -136,7 +136,7 @@ post-install: .endif @${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif - @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh + @${SED} "s|%%PREFIX%%|${PREFIX}|g; s|%%DB_DIR%%|${DB_DIR}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh @${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh .if !defined(NOPORTDOCS) diff --git a/databases/mysql323-server/files/mysql-server.sh b/databases/mysql323-server/files/mysql-server.sh index 6cc4f30ee2df..f22cbd0c8235 100644 --- a/databases/mysql323-server/files/mysql-server.sh +++ b/databases/mysql323-server/files/mysql-server.sh @@ -1,14 +1,21 @@ #!/bin/sh +DB_DIR=%%DB_DIR%% +PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid + case "$1" in start) if [ -x %%PREFIX%%/bin/safe_mysqld ]; then - %%PREFIX%%/bin/safe_mysqld --user=mysql > /dev/null & + %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) - /usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld' + if [ -f ${PIDFILE} ]; then + /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' + else + echo "mysql-server isn't running" + fi ;; *) echo "" diff --git a/databases/mysql40-server/Makefile b/databases/mysql40-server/Makefile index fa666aeab4b7..5011bb848da1 100644 --- a/databases/mysql40-server/Makefile +++ b/databases/mysql40-server/Makefile @@ -7,7 +7,7 @@ PORTNAME?= ${MASTERPORTNAME} PORTVERSION= 3.23.53 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ http://www.kernelnotes.de/MySQL/Downloads/MySQL-3.23/ \ @@ -136,7 +136,7 @@ post-install: .endif @${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif - @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh + @${SED} "s|%%PREFIX%%|${PREFIX}|g; s|%%DB_DIR%%|${DB_DIR}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh @${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh .if !defined(NOPORTDOCS) diff --git a/databases/mysql40-server/files/mysql-server.sh b/databases/mysql40-server/files/mysql-server.sh index 6cc4f30ee2df..f22cbd0c8235 100644 --- a/databases/mysql40-server/files/mysql-server.sh +++ b/databases/mysql40-server/files/mysql-server.sh @@ -1,14 +1,21 @@ #!/bin/sh +DB_DIR=%%DB_DIR%% +PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid + case "$1" in start) if [ -x %%PREFIX%%/bin/safe_mysqld ]; then - %%PREFIX%%/bin/safe_mysqld --user=mysql > /dev/null & + %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) - /usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld' + if [ -f ${PIDFILE} ]; then + /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' + else + echo "mysql-server isn't running" + fi ;; *) echo "" diff --git a/databases/mysql41-server/Makefile b/databases/mysql41-server/Makefile index fa666aeab4b7..5011bb848da1 100644 --- a/databases/mysql41-server/Makefile +++ b/databases/mysql41-server/Makefile @@ -7,7 +7,7 @@ PORTNAME?= ${MASTERPORTNAME} PORTVERSION= 3.23.53 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ http://www.kernelnotes.de/MySQL/Downloads/MySQL-3.23/ \ @@ -136,7 +136,7 @@ post-install: .endif @${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif - @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh + @${SED} "s|%%PREFIX%%|${PREFIX}|g; s|%%DB_DIR%%|${DB_DIR}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh @${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh .if !defined(NOPORTDOCS) diff --git a/databases/mysql41-server/files/mysql-server.sh b/databases/mysql41-server/files/mysql-server.sh index 6cc4f30ee2df..f22cbd0c8235 100644 --- a/databases/mysql41-server/files/mysql-server.sh +++ b/databases/mysql41-server/files/mysql-server.sh @@ -1,14 +1,21 @@ #!/bin/sh +DB_DIR=%%DB_DIR%% +PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid + case "$1" in start) if [ -x %%PREFIX%%/bin/safe_mysqld ]; then - %%PREFIX%%/bin/safe_mysqld --user=mysql > /dev/null & + %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) - /usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld' + if [ -f ${PIDFILE} ]; then + /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' + else + echo "mysql-server isn't running" + fi ;; *) echo "" diff --git a/databases/mysql50-server/Makefile b/databases/mysql50-server/Makefile index fa666aeab4b7..5011bb848da1 100644 --- a/databases/mysql50-server/Makefile +++ b/databases/mysql50-server/Makefile @@ -7,7 +7,7 @@ PORTNAME?= ${MASTERPORTNAME} PORTVERSION= 3.23.53 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ http://www.kernelnotes.de/MySQL/Downloads/MySQL-3.23/ \ @@ -136,7 +136,7 @@ post-install: .endif @${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif - @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh + @${SED} "s|%%PREFIX%%|${PREFIX}|g; s|%%DB_DIR%%|${DB_DIR}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh @${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh .if !defined(NOPORTDOCS) diff --git a/databases/mysql50-server/files/mysql-server.sh b/databases/mysql50-server/files/mysql-server.sh index 6cc4f30ee2df..f22cbd0c8235 100644 --- a/databases/mysql50-server/files/mysql-server.sh +++ b/databases/mysql50-server/files/mysql-server.sh @@ -1,14 +1,21 @@ #!/bin/sh +DB_DIR=%%DB_DIR%% +PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid + case "$1" in start) if [ -x %%PREFIX%%/bin/safe_mysqld ]; then - %%PREFIX%%/bin/safe_mysqld --user=mysql > /dev/null & + %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) - /usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld' + if [ -f ${PIDFILE} ]; then + /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' + else + echo "mysql-server isn't running" + fi ;; *) echo "" diff --git a/databases/mysql51-server/Makefile b/databases/mysql51-server/Makefile index fa666aeab4b7..5011bb848da1 100644 --- a/databases/mysql51-server/Makefile +++ b/databases/mysql51-server/Makefile @@ -7,7 +7,7 @@ PORTNAME?= ${MASTERPORTNAME} PORTVERSION= 3.23.53 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ http://www.kernelnotes.de/MySQL/Downloads/MySQL-3.23/ \ @@ -136,7 +136,7 @@ post-install: .endif @${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif - @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh + @${SED} "s|%%PREFIX%%|${PREFIX}|g; s|%%DB_DIR%%|${DB_DIR}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh @${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh .if !defined(NOPORTDOCS) diff --git a/databases/mysql51-server/files/mysql-server.sh b/databases/mysql51-server/files/mysql-server.sh index 6cc4f30ee2df..f22cbd0c8235 100644 --- a/databases/mysql51-server/files/mysql-server.sh +++ b/databases/mysql51-server/files/mysql-server.sh @@ -1,14 +1,21 @@ #!/bin/sh +DB_DIR=%%DB_DIR%% +PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid + case "$1" in start) if [ -x %%PREFIX%%/bin/safe_mysqld ]; then - %%PREFIX%%/bin/safe_mysqld --user=mysql > /dev/null & + %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) - /usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld' + if [ -f ${PIDFILE} ]; then + /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' + else + echo "mysql-server isn't running" + fi ;; *) echo "" diff --git a/databases/mysql54-server/Makefile b/databases/mysql54-server/Makefile index fa666aeab4b7..5011bb848da1 100644 --- a/databases/mysql54-server/Makefile +++ b/databases/mysql54-server/Makefile @@ -7,7 +7,7 @@ PORTNAME?= ${MASTERPORTNAME} PORTVERSION= 3.23.53 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ http://www.kernelnotes.de/MySQL/Downloads/MySQL-3.23/ \ @@ -136,7 +136,7 @@ post-install: .endif @${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif - @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh + @${SED} "s|%%PREFIX%%|${PREFIX}|g; s|%%DB_DIR%%|${DB_DIR}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh @${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh .if !defined(NOPORTDOCS) diff --git a/databases/mysql54-server/files/mysql-server.sh b/databases/mysql54-server/files/mysql-server.sh index 6cc4f30ee2df..f22cbd0c8235 100644 --- a/databases/mysql54-server/files/mysql-server.sh +++ b/databases/mysql54-server/files/mysql-server.sh @@ -1,14 +1,21 @@ #!/bin/sh +DB_DIR=%%DB_DIR%% +PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid + case "$1" in start) if [ -x %%PREFIX%%/bin/safe_mysqld ]; then - %%PREFIX%%/bin/safe_mysqld --user=mysql > /dev/null & + %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) - /usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld' + if [ -f ${PIDFILE} ]; then + /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' + else + echo "mysql-server isn't running" + fi ;; *) echo "" diff --git a/databases/mysql55-server/Makefile b/databases/mysql55-server/Makefile index fa666aeab4b7..5011bb848da1 100644 --- a/databases/mysql55-server/Makefile +++ b/databases/mysql55-server/Makefile @@ -7,7 +7,7 @@ PORTNAME?= ${MASTERPORTNAME} PORTVERSION= 3.23.53 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ http://www.kernelnotes.de/MySQL/Downloads/MySQL-3.23/ \ @@ -136,7 +136,7 @@ post-install: .endif @${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif - @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh + @${SED} "s|%%PREFIX%%|${PREFIX}|g; s|%%DB_DIR%%|${DB_DIR}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh @${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh .if !defined(NOPORTDOCS) diff --git a/databases/mysql55-server/files/mysql-server.sh b/databases/mysql55-server/files/mysql-server.sh index 6cc4f30ee2df..f22cbd0c8235 100644 --- a/databases/mysql55-server/files/mysql-server.sh +++ b/databases/mysql55-server/files/mysql-server.sh @@ -1,14 +1,21 @@ #!/bin/sh +DB_DIR=%%DB_DIR%% +PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid + case "$1" in start) if [ -x %%PREFIX%%/bin/safe_mysqld ]; then - %%PREFIX%%/bin/safe_mysqld --user=mysql > /dev/null & + %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) - /usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld' + if [ -f ${PIDFILE} ]; then + /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' + else + echo "mysql-server isn't running" + fi ;; *) echo "" diff --git a/databases/mysql60-server/Makefile b/databases/mysql60-server/Makefile index fa666aeab4b7..5011bb848da1 100644 --- a/databases/mysql60-server/Makefile +++ b/databases/mysql60-server/Makefile @@ -7,7 +7,7 @@ PORTNAME?= ${MASTERPORTNAME} PORTVERSION= 3.23.53 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ http://www.kernelnotes.de/MySQL/Downloads/MySQL-3.23/ \ @@ -136,7 +136,7 @@ post-install: .endif @${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif - @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh + @${SED} "s|%%PREFIX%%|${PREFIX}|g; s|%%DB_DIR%%|${DB_DIR}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh @${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh .if !defined(NOPORTDOCS) diff --git a/databases/mysql60-server/files/mysql-server.sh b/databases/mysql60-server/files/mysql-server.sh index 6cc4f30ee2df..f22cbd0c8235 100644 --- a/databases/mysql60-server/files/mysql-server.sh +++ b/databases/mysql60-server/files/mysql-server.sh @@ -1,14 +1,21 @@ #!/bin/sh +DB_DIR=%%DB_DIR%% +PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid + case "$1" in start) if [ -x %%PREFIX%%/bin/safe_mysqld ]; then - %%PREFIX%%/bin/safe_mysqld --user=mysql > /dev/null & + %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) - /usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld' + if [ -f ${PIDFILE} ]; then + /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' + else + echo "mysql-server isn't running" + fi ;; *) echo "" diff --git a/databases/percona55-server/Makefile b/databases/percona55-server/Makefile index fa666aeab4b7..5011bb848da1 100644 --- a/databases/percona55-server/Makefile +++ b/databases/percona55-server/Makefile @@ -7,7 +7,7 @@ PORTNAME?= ${MASTERPORTNAME} PORTVERSION= 3.23.53 -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= databases MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ http://www.kernelnotes.de/MySQL/Downloads/MySQL-3.23/ \ @@ -136,7 +136,7 @@ post-install: .endif @${SETENV} DB_DIR=${DB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif - @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh + @${SED} "s|%%PREFIX%%|${PREFIX}|g; s|%%DB_DIR%%|${DB_DIR}|g" < ${FILESDIR}/mysql-server.sh > ${PREFIX}/etc/rc.d/mysql-server.sh @${CHMOD} 750 ${PREFIX}/etc/rc.d/mysql-server.sh .if !defined(NOPORTDOCS) diff --git a/databases/percona55-server/files/mysql-server.sh b/databases/percona55-server/files/mysql-server.sh index 6cc4f30ee2df..f22cbd0c8235 100644 --- a/databases/percona55-server/files/mysql-server.sh +++ b/databases/percona55-server/files/mysql-server.sh @@ -1,14 +1,21 @@ #!/bin/sh +DB_DIR=%%DB_DIR%% +PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid + case "$1" in start) if [ -x %%PREFIX%%/bin/safe_mysqld ]; then - %%PREFIX%%/bin/safe_mysqld --user=mysql > /dev/null & + %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) - /usr/bin/killall mysqld > /dev/null 2>&1 && echo -n ' mysqld' + if [ -f ${PIDFILE} ]; then + /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' + else + echo "mysql-server isn't running" + fi ;; *) echo "" -- cgit v1.2.3