#!/bin/sh
#
# mod_fcgid	No service.
#
# chkconfig: - 03 99
# description:	check subdirectory in /var/run \
#		must start before Apache
# processname: mod_fcgid
# config:
# pidfile:

### BEGIN INIT INFO
# Provides:          mod_fcgid
# Required-Start:    $local_fs
# Required-Stop:
# Default-Start:     3 4 5
# Default-Stop:
# Short-Description: check subdirectory in /var/run
# Description:       check subdirectory in /var/run
### END INIT INFO

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

PIDFILE=
LOCKFILE=
RETVAL=0

start()
{
	[ -d "/var/run/mod_fcgid/fcgid_sock" ] || {
	    mkdir -p "/var/run/mod_fcgid/fcgid_sock"
	    chown -R apache2:apache2 "/var/run/mod_fcgid"
	    chmod -R 755 "/var/run/mod_fcgid"
        }
}

stop()
{
	NOP=
}

restart()
{
	NOP=
}

reload()
{
	NOP=
}

# See how we were called.
case "$1" in
	start)
		start
		;;
	stop)
		;;
	reload)
		;;
	restart)
		;;
	condstop)
		;;
	condrestart)
		;;
	condreload)
		;;
	status)
# possible need to check /var/run/mod_fcgid
#		RETVAL=$?
		;;
	*)
		msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
		RETVAL=1
esac

exit $RETVAL
