CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
nss: updated to 3.19. Disables SSL3
[ports/opt-arm.git] / mysql / mysqld
CommitLineData
825e3023
VM
1#!/bin/sh
2#
3# /etc/rc.d/mysqld: start/stop mysqld daemon
4#
5
199f2d02
VM
6SSD=/sbin/start-stop-daemon
7PROG=/usr/sbin/mysqld
825e3023 8MYSQL_CFG=/etc/my.cnf
199f2d02
VM
9PID=$(sed -n 's/^pid-file[ \t]*=[ \t]*//p' $MYSQL_CFG)
10USR=$(sed -n 's/^user[ \t]*=[ \t]*//p' $MYSQL_CFG)
825e3023
VM
11
12case $1 in
13start)
199f2d02
VM
14 touch $PID && chown $USR:$USR $PID
15 $SSD --start --background --pidfile $PID --exec $PROG
825e3023
VM
16 ;;
17stop)
199f2d02 18 $SSD --stop --remove-pidfile --retry 10 --pidfile $PID
825e3023
VM
19 ;;
20restart)
21 $0 stop
825e3023
VM
22 $0 start
23 ;;
199f2d02
VM
24status)
25 $SSD --status --pidfile $PID
26 case $? in
27 0) echo "$PROG is running with pid $(cat $PID)" ;;
28 1) echo "$PROG is not running but the pid file $PID exists" ;;
29 3) echo "$PROG is not running" ;;
30 4) echo "Unable to determine the program status" ;;
31 esac
32 ;;
825e3023 33*)
199f2d02 34 echo "usage: $0 [start|stop|restart|status]"
825e3023
VM
35 ;;
36esac
37
38# End of file