aboutsummaryrefslogtreecommitdiffstats
path: root/databases/mysql54-server/files/mysql-server.sh
blob: 6a5acb39a962f516a63294293f4b05c71d753772 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

DB_DIR=%%DB_DIR%%
PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid

case "$1" in
    start)
        if [ -x %%PREFIX%%/bin/safe_mysqld ]; then
            /usr/bin/limits -U mysql \
            %%PREFIX%%/bin/safe_mysqld --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null &
            echo -n ' mysqld'
        fi
        ;;
    stop)
        if [ -f ${PIDFILE} ]; then
            /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld'
        else
            echo "mysql-server isn't running"
        fi
        ;;
    *)
        echo ""
        echo "Usage: `basename $0` { start | stop }"
        echo ""
        exit 64
        ;;
esac