summaryrefslogtreecommitdiff
path: root/mariadb/mariadb.rc
blob: 74c7bb8cd5e7b1f75fbc6bbf2a6d6783b70c42b5 (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/mariadb: start/stop mariadb daemon
    4 #
    5 
    6 SSD=/sbin/start-stop-daemon
    7 PROG=/usr/sbin/mysqld
    8 NAME=mysqld
    9 PID=/run/mysqld/mysqld.pid
   10 OPTS="--pid-file=$PID --user=mysql"
   11 
   12 case $1 in
   13 start)
   14 	install -o mysql -g mysql -m 0755 -d /run/mysqld
   15 	$SSD --start -bC --pidfile $PID --exec $PROG -- $OPTS
   16 	;;
   17 stop)
   18 	$SSD --stop --remove-pidfile --retry 10 --name $NAME --pidfile $PID
   19 	;;
   20 restart)
   21 	$0 stop
   22 	$0 start
   23 	;;
   24 status)
   25 	$SSD --status --name $NAME --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 	;;
   33 *)
   34 	echo "usage: $0 [start|stop|restart|status]"
   35 	;;
   36 esac
   37 
   38 # End of file

Generated by cgit