<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.sachsen.schule/dwiki/index.php?action=history&amp;feed=atom&amp;title=Benutzer%3AHarry%2Ftest.sh</id>
	<title>Benutzer:Harry/test.sh - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sachsen.schule/dwiki/index.php?action=history&amp;feed=atom&amp;title=Benutzer%3AHarry%2Ftest.sh"/>
	<link rel="alternate" type="text/html" href="https://wiki.sachsen.schule/dwiki/index.php?title=Benutzer:Harry/test.sh&amp;action=history"/>
	<updated>2026-05-04T10:04:07Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Delixs</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.sachsen.schule/dwiki/index.php?title=Benutzer:Harry/test.sh&amp;diff=6684&amp;oldid=prev</id>
		<title>Harry: Die Seite wurde neu angelegt: &lt;pre&gt; #!/bin/sh -e # # apache2               This init.d script is used to start apache2. #                       It basically just calls apache2ctl.  ENV=&quot;env -i LANG=...</title>
		<link rel="alternate" type="text/html" href="https://wiki.sachsen.schule/dwiki/index.php?title=Benutzer:Harry/test.sh&amp;diff=6684&amp;oldid=prev"/>
		<updated>2009-03-10T14:00:13Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: &amp;lt;pre&amp;gt; #!/bin/sh -e # # apache2               This init.d script is used to start apache2. #                       It basically just calls apache2ctl.  ENV=&amp;quot;env -i LANG=...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh -e&lt;br /&gt;
#&lt;br /&gt;
# apache2               This init.d script is used to start apache2.&lt;br /&gt;
#                       It basically just calls apache2ctl.&lt;br /&gt;
&lt;br /&gt;
ENV=&amp;quot;env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#[ `ls -1 /etc/apache2/sites-enabled/ | wc -l | sed -e &amp;#039;s/ *//;&amp;#039;` -eq 0 ] &amp;amp;&amp;amp; \&lt;br /&gt;
#echo &amp;quot;You haven&amp;#039;t enabled any sites yet, so I&amp;#039;m not starting apache2.&amp;quot; &amp;amp;&amp;amp; \&lt;br /&gt;
#echo &amp;quot;To add and enable a host, use addhost and enhost.&amp;quot; &amp;amp;&amp;amp; exit 0&lt;br /&gt;
&lt;br /&gt;
#edit /etc/default/apache2 to change this.&lt;br /&gt;
NO_START=0&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
if [ -x /usr/sbin/apache2 ] ; then&lt;br /&gt;
        HAVE_APACHE2=1&lt;br /&gt;
else&lt;br /&gt;
        echo &amp;quot;No apache MPM package installed&amp;quot;&lt;br /&gt;
        exit 0&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
. /lib/lsb/init-functions&lt;br /&gt;
&lt;br /&gt;
test -f /etc/default/rcS &amp;amp;&amp;amp; . /etc/default/rcS&lt;br /&gt;
test -f /etc/default/apache2 &amp;amp;&amp;amp; . /etc/default/apache2&lt;br /&gt;
if [ &amp;quot;$NO_START&amp;quot; != &amp;quot;0&amp;quot; -a &amp;quot;$1&amp;quot; != &amp;quot;stop&amp;quot; ]; then&lt;br /&gt;
        log_warning_msg &amp;quot;Not starting apache2 - edit /etc/default/apache2 and change NO_START to be 0.&amp;quot;;&lt;br /&gt;
        exit 0;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
APACHE2=&amp;quot;$ENV /usr/sbin/apache2&amp;quot;&lt;br /&gt;
APACHE2CTL=&amp;quot;$ENV /usr/sbin/apache2ctl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
pidof_apache() {&lt;br /&gt;
    # if pidof is null for some reasons the script exits automagically&lt;br /&gt;
    # classified as good/unknown feature&lt;br /&gt;
    PIDS=`pidof apache2` || true&lt;br /&gt;
&lt;br /&gt;
    PID=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # let&amp;#039;s try to find the pid file&lt;br /&gt;
    # apache2 allows more than PidFile entry in the config but only&lt;br /&gt;
    PID=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # let&amp;#039;s try to find the pid file&lt;br /&gt;
    # apache2 allows more than PidFile entry in the config but only&lt;br /&gt;
    # the last found in the config is used&lt;br /&gt;
    for PFILE in `grep ^PidFile /etc/apache2/* -r | awk &amp;#039;{print $2}&amp;#039;`; do&lt;br /&gt;
        if [ -e $PFILE ]; then&lt;br /&gt;
            cat $PFILE&lt;br /&gt;
            return 0&lt;br /&gt;
        fi&lt;br /&gt;
    done&lt;br /&gt;
    REALPID=0&lt;br /&gt;
    # if there is a pid we need to verify that belongs to apache2&lt;br /&gt;
    # for real&lt;br /&gt;
    for i in $PIDS; do&lt;br /&gt;
        if [ &amp;quot;$i&amp;quot; = &amp;quot;$PID&amp;quot; ]; then&lt;br /&gt;
            # in this case the pid stored in the&lt;br /&gt;
            # pidfile matches one of the pidof apache&lt;br /&gt;
            # so a simple kill will make it&lt;br /&gt;
            echo $PID&lt;br /&gt;
            return 0&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apache_stop() {&lt;br /&gt;
        if `apache2 -t &amp;gt; /dev/null 2&amp;gt;&amp;amp;1`; then&lt;br /&gt;
                # if the config is ok than we just stop normaly&lt;br /&gt;
                $APACHE2 -k stop&lt;br /&gt;
        else&lt;br /&gt;
                # if we are here something is broken and we need to try&lt;br /&gt;
                # to exit as nice and clean as possible&lt;br /&gt;
                PID=$(pidof_apache)&lt;br /&gt;
&lt;br /&gt;
                if [ &amp;quot;${PID}&amp;quot; ]; then&lt;br /&gt;
                        # in this case it is everything nice and dandy&lt;br /&gt;
                        # and we kill apache2&lt;br /&gt;
                        kill $PID&lt;br /&gt;
                elif [ &amp;quot;$(pidof apache2)&amp;quot; ]; then&lt;br /&gt;
                        if [ &amp;quot;$VERBOSE&amp;quot; != no ]; then&lt;br /&gt;
                                echo &amp;quot; ... failed!&amp;quot;&lt;br /&gt;
                                echo &amp;quot;You may still have some apache2 processes&lt;br /&gt;
running.  There are&amp;quot;&lt;br /&gt;
                                echo &amp;quot;processes named &amp;#039;apache2&amp;#039; which do not match your pid file,&amp;quot;&lt;br /&gt;
                                echo &amp;quot;and in the name of safety, we&amp;#039;ve left them alone.  Please review&amp;quot;&lt;br /&gt;
                                echo &amp;quot;the situation by hand.&amp;quot;&lt;br /&gt;
                        fi&lt;br /&gt;
                        return 1&lt;br /&gt;
                fi&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
apache_sync_stop() {&lt;br /&gt;
        # running ?&lt;br /&gt;
        PIDTMP=$(pidof_apache)&lt;br /&gt;
        if $(kill -0 &amp;quot;${PIDTMP:-}&amp;quot; 2&amp;gt; /dev/null); then&lt;br /&gt;
            PID=$PIDTMP&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        apache_stop&lt;br /&gt;
&lt;br /&gt;
        # wait until really stopped&lt;br /&gt;
        if [ -n &amp;quot;${PID:-}&amp;quot; ]; then&lt;br /&gt;
                i=0&lt;br /&gt;
                while $(kill -0 &amp;quot;${PID:-}&amp;quot; 2&amp;gt; /dev/null);  do&lt;br /&gt;
                        if [ $i = &amp;#039;30&amp;#039; ]; then&lt;br /&gt;
                                break;&lt;br /&gt;
                        else&lt;br /&gt;
                                if [ $i = &amp;#039;0&amp;#039; ]; then&lt;br /&gt;
                                        echo -n &amp;quot; waiting &amp;quot;&lt;br /&gt;
                                else&lt;br /&gt;
                                        echo -n &amp;quot;.&amp;quot;&lt;br /&gt;
                                fi&lt;br /&gt;
                                i=$(($i+1))&lt;br /&gt;
                                sleep 2&lt;br /&gt;
                      fi&lt;br /&gt;
                 done&lt;br /&gt;
        fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Stupid hack to keep lintian happy. (Warrk! Stupidhack!).&lt;br /&gt;
case $1 in&lt;br /&gt;
        start)&lt;br /&gt;
                [ -f /etc/apache2/httpd.conf ] || touch /etc/apache2/httpd.conf&lt;br /&gt;
                [ -d /var/run/apache2 ] || mkdir -p /var/run/apache2&lt;br /&gt;
                install -d -o www-data /var/lock/apache2&lt;br /&gt;
                #ssl_scache shouldn&amp;#039;t be here if we&amp;#039;re just starting up.&lt;br /&gt;
                [ -f /var/run/apache2/ssl_scache ] &amp;amp;&amp;amp; rm -f /var/run/apache2/*ssl_scache*&lt;br /&gt;
                log_begin_msg &amp;quot;Starting web server (apache2)...&amp;quot;&lt;br /&gt;
                if $APACHE2CTL start; then&lt;br /&gt;
                        log_end_msg 0&lt;br /&gt;
                else&lt;br /&gt;
                        log_end_msg 1&lt;br /&gt;
                fi&lt;br /&gt;
        ;;&lt;br /&gt;
        stop)&lt;br /&gt;
                log_begin_msg &amp;quot;Stopping web server (apache2)...&amp;quot;&lt;br /&gt;
                if apache_stop; then&lt;br /&gt;
                        log_end_msg 0&lt;br /&gt;
                else&lt;br /&gt;
                        log_end_msg 1&lt;br /&gt;
                fi&lt;br /&gt;
        ;;&lt;br /&gt;
        reload)&lt;br /&gt;
                if ! $APACHE2CTL configtest &amp;gt; /dev/null 2&amp;gt;&amp;amp;1; then&lt;br /&gt;
                    $APACHE2CTL configtest || true&lt;br /&gt;
                    log_end_msg 1&lt;br /&gt;
                    exit 1&lt;br /&gt;
                fi&lt;br /&gt;
                log_begin_msg &amp;quot;Reloading web server config...&amp;quot;&lt;br /&gt;
                if pidof_apache; then&lt;br /&gt;
                    if $APACHE2CTL graceful $2 ; then&lt;br /&gt;
                        log_end_msg 0&lt;br /&gt;
                    else&lt;br /&gt;
                        log_end_msg 1&lt;br /&gt;
                    fi&lt;br /&gt;
                fi&lt;br /&gt;
        ;;&lt;br /&gt;
        restart | force-reload)&lt;br /&gt;
                log_begin_msg &amp;quot;Forcing reload of web server (apache2)...&amp;quot;&lt;br /&gt;
                if ! apache_sync_stop; then&lt;br /&gt;
                        log_end_msg 1&lt;br /&gt;
                fi&lt;br /&gt;
                if $APACHE2CTL start; then&lt;br /&gt;
                        log_end_msg 0&lt;br /&gt;
                else&lt;br /&gt;
                        log_end_msg 1&lt;br /&gt;
                fi&lt;br /&gt;
        ;;&lt;br /&gt;
        *)&lt;br /&gt;
                log_success_msg &amp;quot;Usage: /etc/init.d/apache2 {start|stop|restart|reload|force-reload}&amp;quot;&lt;br /&gt;
        ;;&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Harry</name></author>
	</entry>
</feed>