Sisyphus repositório
Última atualização: 22 setembro 2019 | SRPMs: 17472 | Visitas: 15140036
en ru br
ALT Linux repositórios
S:2.4.41-alt1
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
#
# @name@ 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: @name@
# pidfile: @pidfile@
# config: @conffile@

WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions
if [ -f /etc/sysconfig/@name@ ]; then
. /etc/sysconfig/@name@
fi

# 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@@name@.worker in /etc/sysconfig/@name@ 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-@name@}
BINARY=/usr/sbin/$name
moduledir=@modules@
moduleargs=
PIDFILE=@pidfile@
LOCKFILE=/var/lock/subsys/@name@
RETVAL=0

export TMPDIR=@a_spooldir@/tmp

### Hack for bad hostname configuration
thehost=`hostname`
hostname -i 1>/dev/null 2>/dev/null|| hostname localhost

### Hack for Status
LYNX="lynx -dump"
STATUSURL="http://localhost/server-status"

# Change the major functions into functions.
moduleargs() {
for module in ${moduledir}/*.so ; do
if [ -x ${module} ] ; then
module=`echo ${module} |
sed -e 's/.*\///g; s/^mod_//g; s/^lib//g; s/\.so//g;'|
tr '[:lower:]' '[:upper:]'`
moduleargs="${moduleargs} -DHAVE_$module"
fi
done
echo ${moduleargs}
}

conftest() {
# TODO: translatable form?
action "Checking configuration sanity for $name: " \
"$BINARY" -t `moduleargs` $OPTIONS $DEFINE
RETVAL=$?
return $RETVAL
}

start()
{
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" \
--expect-user root --name $name -- $BINARY $OPTIONS
RETVAL=$?
return $RETVAL
}

stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" \
--expect-user root --name $name -- $BINARY
RETVAL=$?
return $RETVAL
}

reload()
{
msg_reloading $name
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" \
--expect-user root --name $name -HUP -- $BINARY
RETVAL=$?
return $RETVAL
}

restart()
{
stop
sleep 1
conftest || exit $?
start
}

briefstatus()
{
status --pidfile "$PIDFILE" --expect-user root \
--expect-user root --name $name -- $BINARY
RETVAL=$?
return $RETVAL
}

extendedstatus()
{
if briefstatus >/dev/null; then
RETVAL=$?
$LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
else
RETVAL=$?
msg_not_running "$name"
echo
fi
return $RETVAL
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload|graceful)
if [ -e $moduledir/mod_jserv.so ]; then
restart
else
reload
fi
;;
check|configtest)
conftest
exit $?
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
update|condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
extendedstatus)
extendedstatus
;;
status)
briefstatus
;;
*)
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