#!/bin/sh
#
# This file shoud be located in your init.d directory (e.g. /etc/rc.d/init.d).
# From there you should make symbolic links in your rc#.d dirs to this file,
# Typically rc2.d or rc3.d is used in /etc/rc.d/rc#.d/ or /etc/rc#.d
#
# Symbolic links are made like this:
# cd /etc/rc.d/rc3.d
# ln -s ../init.d/mysqld S99mysqld
#
case "$1" in
start)
echo -n "Starting MySQL-deamon: "
/usr/local/mysql/bin/mysqld_safe --user=*****--pid-file=/*****/mysql.pid &
;;
stop)
echo -n "Shutting down MySQL-deamon: "
MYSQLPID=`cat /*****/mysql.pid`
#kill $MYSQLPID
echo "dödar $MYSQLPID"
;;
restart)
echo "Restarting MySQL-deamon: "
service mysqld stop
service mysqld start
;;
*)
echo "Usage: mysqld {start|stop|restart}"
exit 1
esac
exit 0
Hur ska jag skriva under "stop" sectionen, så att kommandot "kill" inte utförs om mysqld inte är igång? Jag vill ju inte råka döda något annat prog bara för det har samma pid som mysql hade sist det var startat..