#!/bin/sh

#################################################################################
#
#   Lynis
# ------------------
#
# Copyright 2007-2008, Michael Boelen (michael@rootkit.nl), The Netherlands
# Web site: http://www.rootkit.nl
#
# Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
# welcome to redistribute it under the terms of the GNU General Public License.
# See LICENSE file for usage of this software.
#
#################################################################################
#
# Databases
#
#################################################################################
#
    # MySQL specific options
    MYSQL_RUNNING=0
    # Paths to DATADIR
    sMYSQLDBPATHS="/var/lib/mysql"
    # Paths to my.cnf
    sMYCNFLOCS="/etc/mysql/my.cnf /usr/etc/my.cnf"
#
#################################################################################
#
    InsertSection "Databases"
    
    # Test        : DBS-1804
    # Description : Check if MySQL is being used
    Register --test-no DBS-1804 --weight L --network NO --description "Checking active MySQL process"
    if [ ${SKIPTEST} -eq 0 ]; then
	FIND=`ps ax | egrep "mysqld|mysqld_safe" | grep -v "grep"`
	if [ "${FIND}" = "" ]; then
	    Display --indent 2 --text "- MySQL process status..." --result RUNNING --color GREEN
	    logtext "Result: MySQL is active"
	    MYSQL_RUNNING=1
	  else
	    Display --indent 2 --text "- MySQL process status..." --result "NOT ACTIVE" --color WHITE
	    logtext "Result: MySQL process not active"
	    MYSQL_RUNNING=0
	fi
    fi
#
#################################################################################
#
    # Test        : DBS-1808
    # Description : Check MySQL data directory
    #Register --test-no DBS-1808 --weight L --network NO --description "Checking MySQL data directory"
    #if [ ${SKIPTEST} -eq 0 ]; then
    #fi
#
#################################################################################
#
    # Test        : DBS-1812
    # Description : Check data directory permissions
    #Register --test-no DBS-1812 --weight L --network NO --description "Checking MySQL data directory permissions"
    #if [ ${SKIPTEST} -eq 0 ]; then
    #fi
#
#################################################################################
#

wait_for_keypress

#
#================================================================================
# Lynis - Copyright 2007-2008, Michael Boelen - www.rootkit.nl - The Netherlands
