Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37046069
en ru br
ALT Linux repositórios
S:2.4.57-alt2
D:2.2.9-alt11
5.0: 2.2.24-alt2.M50.1
4.1: 2.2.8-alt1
4.0: 2.2.6-alt4
+updates:2.2.6-alt2
3.0: 2.0.55-alt1
+backports:2.0.59-alt0.M30.1

Outros repositórios
Upstream:2.2.8

Group :: Sistema/Servidores
RPM: apache2

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

#! /bin/sh
#
# %apache2_dname Start/Stop the Apache2 Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: %apache2_dname
# pidfile: %apache2_pidfile
# config: %apache2_conf
#
### BEGIN INIT INFO
# Provides: %apache2_dname
# Required-Start: $local_fs $remote_fs $network $named
# Required-Stop: $local_fs $remote_fs $network
# Should-Start: distcache
# Short-Description: start and stop Apache HTTP Server
# Description: The Apache HTTP Server is an extensible server
# implementing the current HTTP standards.
### END INIT INFO

WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions
SourceIfExists %apache2_envconf

# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=""

# Set HTTPD=%apache2_dname.worker in %apache2_envconf to use a server
# with the thread-based "worker" MPM; BE WARNED that some modules may not
# work correctly with a thread-based MPM; notably PHP will refuse to start.
name=${HTTPD-%apache2_dname}
moduledir=%apache2_moduledir
moduleargs=
APACHECTL=%apache2_apachectl
RETVAL=0

export TMPDIR=%apache2_spooldir/tmp

### Hack for bad hostname configuration
thehost=`hostname`
hostname -i 1>/dev/null 2>/dev/null|| echo "WARNING: hostname is not set correctly, thus Apache may not run correctly either."

# Check vars
if ! echo "$WAITSTOP" \
| head -n 1 \
| grep -q '^[[:space:]]*0*[1-9][0-9]*[[:space:]]*$' ; then
WAITSTOP=300
fi

# Change the major functions into functions.
conftest() {
%apache2_sslcertsh generate %apache2_sslcertname

# TODO: translatable form?
action "Checking configuration sanity for $name: " \
"$APACHECTL" configtest
RETVAL=$?
return $RETVAL
}

start()
{
%apache2_sslcertsh generate %apache2_sslcertname

action "`msg_starting $name` " \
"$APACHECTL" start
RETVAL=$?
return $RETVAL
}

stop_wait()
{
for (( i=$1; $i>0; i=(($i-1)) )); do
"$APACHECTL" stop >/dev/null 2>&1
RETVAL=$?
if [ $RETVAL -ne 255 ]; then
return $RETVAL
fi
printf '%5s' "$i"
sleep 1
printf "\b\b\b\b\b \b\b\b\b\b"
done
"$APACHECTL" stop >/dev/null 2>&1
RETVAL=$?
return $RETVAL
}

stop()
{
msg_stopping $name
stop_wait $WAITSTOP
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo_success
echo
else
echo_failure
echo
fi
return $RETVAL
}

reload()
{
action "`msg_reloading $name` " \
"$APACHECTL" restart
RETVAL=$?
return $RETVAL
}

restart()
{
stop
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
conftest || exit $?
start
RETVAL=$?
fi
return $RETVAL
}

briefstatus()
{
"$APACHECTL" briefstatus
RETVAL=$?
return $RETVAL
}

extendedstatus()
{
"$APACHECTL" status
RETVAL=$?
return $RETVAL
}

# See how we were called.
case "$1" in
start)
start
RETVAL=$?
;;
stop)
stop
RETVAL=$?
;;
restart)
restart
RETVAL=$?
;;
reload|graceful)
if [ -e $moduledir/mod_jserv.so ]; then
restart
RETVAL=$?
else
reload
RETVAL=$?
fi
;;
check|configtest)
conftest
RETVAL=$?
;;
condstop)
if briefstatus >/dev/null 2>&1; then
stop
RETVAL=$?
else
RETVAL=0
fi
;;
update|condrestart)
if briefstatus >/dev/null 2>&1; then
restart
RETVAL=$?
else
RETVAL=0
fi
;;
condreload)
if briefstatus >/dev/null 2>&1; then
reload
RETVAL=$?
else
RETVAL=0
fi
;;
extendedstatus)
extendedstatus
RETVAL=$?
;;
status)
briefstatus
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|check|configtest|condstop|condrestart|condreload|status}"
RETVAL=1
esac

exit $RETVAL
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009