head 1.28; access; symbols OPENPKG_E1_MP_HEAD:1.23 OPENPKG_E1_MP:1.23 OPENPKG_E1_MP_2_STABLE:1.21.2.2 OPENPKG_E1_FP:1.21.2.2 OPENPKG_2_STABLE_MP:1.23 OPENPKG_2_STABLE_20061018:1.21.2.2 OPENPKG_2_STABLE_20060622:1.21 OPENPKG_2_STABLE:1.21.0.2 OPENPKG_2_STABLE_BP:1.21 OPENPKG_2_5_RELEASE:1.19 OPENPKG_2_5_SOLID:1.19.0.4 OPENPKG_2_5_SOLID_BP:1.19 OPENPKG_2_4_RELEASE:1.19 OPENPKG_2_4_SOLID:1.19.0.2 OPENPKG_2_4_SOLID_BP:1.19 OPENPKG_CW_FP:1.19 OPENPKG_2_3_RELEASE:1.18 OPENPKG_2_3_SOLID:1.18.0.4 OPENPKG_2_3_SOLID_BP:1.18 OPENPKG_2_2_RELEASE:1.18 OPENPKG_2_2_SOLID:1.18.0.2 OPENPKG_2_2_SOLID_BP:1.18 OPENPKG_2_1_RELEASE:1.17 OPENPKG_2_1_SOLID:1.17.0.4 OPENPKG_2_1_SOLID_BP:1.17 OPENPKG_2_0_RELEASE:1.17 OPENPKG_2_0_SOLID:1.17.0.2 OPENPKG_2_0_SOLID_BP:1.17 OPENPKG_1_3_RELEASE:1.6.4.1 OPENPKG_1_3_SOLID:1.6.4.1.0.2 OPENPKG_1_3_SOLID_BP:1.6.4.1 OPENPKG_1_STABLE_MP:1.15 OPENPKG_1_2_RELEASE:1.6 OPENPKG_1_2_SOLID:1.6.0.6 OPENPKG_1_2_SOLID_BP:1.6 OPENPKG_1_STABLE:1.6.0.4 OPENPKG_1_STABLE_BP:1.6 OPENPKG_1_1_RELEASE:1.6 OPENPKG_1_1_SOLID:1.6.0.2 OPENPKG_1_1_SOLID_BP:1.6 OPENPKG_1_0_RELEASE:1.3 OPENPKG_1_0_SOLID:1.3.0.2 OPENPKG_1_0_SOLID_BP:1.3 OPENPKG_0_0:1.1.1.1 OPENPKG:1.1.1; locks; strict; comment @# @; 1.28 date 2008.11.10.08.38.50; author rse; state Exp; branches; next 1.27; commitid Rj9nNaMtXk2LE2qt; 1.27 date 2007.07.27.16.07.03; author cs; state Exp; branches; next 1.26; commitid b58RuvIXeJJajqrs; 1.26 date 2007.06.23.07.44.23; author rse; state Exp; branches; next 1.25; commitid AUsjPxfUf8vuC0ns; 1.25 date 2007.06.22.17.36.08; author rse; state Exp; branches; next 1.24; commitid K6YrUa6exPpuVVms; 1.24 date 2007.06.22.10.54.02; author rse; state Exp; branches; next 1.23; commitid ZbFoU2hEtnBxHTms; 1.23 date 2006.08.25.19.15.55; author rse; state Exp; branches; next 1.22; commitid Tvsj1UyQ8rQ89gKr; 1.22 date 2006.08.18.14.30.24; author rse; state Exp; branches; next 1.21; commitid M0J0z0UFsdlzNkJr; 1.21 date 2005.12.05.18.52.54; author rse; state Exp; branches 1.21.2.1; next 1.20; commitid YBDG7ubvEIZOtscr; 1.20 date 2005.11.16.07.39.58; author rse; state Exp; branches; next 1.19; commitid dcwesmmy4wfPmX9r; 1.19 date 2005.02.28.13.27.28; author rse; state Exp; branches; next 1.18; 1.18 date 2004.08.13.19.20.39; author rse; state Exp; branches 1.18.4.1; next 1.17; 1.17 date 2004.01.12.18.34.38; author cs; state Exp; branches 1.17.4.1; next 1.16; 1.16 date 2003.12.29.08.54.54; author cs; state Exp; branches; next 1.15; 1.15 date 2003.07.22.12.54.34; author thl; state Exp; branches; next 1.14; 1.14 date 2003.07.22.08.10.38; author rse; state Exp; branches; next 1.13; 1.13 date 2003.07.21.08.12.25; author thl; state Exp; branches; next 1.12; 1.12 date 2003.07.19.17.05.43; author rse; state Exp; branches; next 1.11; 1.11 date 2003.07.17.21.34.31; author thl; state Exp; branches; next 1.10; 1.10 date 2003.07.17.12.49.51; author mlelstv; state Exp; branches; next 1.9; 1.9 date 2003.07.10.07.50.14; author rse; state Exp; branches; next 1.8; 1.8 date 2003.06.24.12.07.38; author thl; state Exp; branches; next 1.7; 1.7 date 2003.03.28.09.59.17; author cs; state Exp; branches; next 1.6; 1.6 date 2002.02.07.14.20.54; author rse; state Exp; branches 1.6.4.1; next 1.5; 1.5 date 2002.01.24.08.32.03; author rse; state Exp; branches; next 1.4; 1.4 date 2002.01.24.08.31.13; author rse; state Exp; branches; next 1.3; 1.3 date 2001.11.26.16.23.23; author rse; state Exp; branches; next 1.2; 1.2 date 2001.09.25.18.35.18; author rse; state Exp; branches; next 1.1; 1.1 date 2001.09.18.09.48.28; author rse; state Exp; branches 1.1.1.1; next ; 1.21.2.1 date 2006.08.18.18.54.04; author rse; state Exp; branches; next 1.21.2.2; commitid d2GG3Hwuamp2gmJr; 1.21.2.2 date 2006.10.16.14.47.40; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; 1.18.4.1 date 2005.02.28.16.06.48; author rse; state Exp; branches; next ; 1.17.4.1 date 2004.08.31.11.03.36; author rse; state Exp; branches; next ; 1.6.4.1 date 2003.07.24.20.43.50; author rse; state Exp; branches; next ; 1.1.1.1 date 2001.09.18.09.48.28; author rse; state Exp; branches; next ; desc @@ 1.28 log @provide daily cache expiring @ text @#!@@l_prefix@@/bin/openpkg rc ## ## rc.apache -- Run-Commands ## %config apache_enable="$openpkg_rc_def" apache_log_files="@@l_prefix@@/var/apache/log/access.log" apache_log_rotsteps="10" apache_log_rotminsize="10M" apache_log_rotcomplevel="9" apache_log_rotprolog="true" apache_log_rotepilog="true" apache_err_files="@@l_prefix@@/var/apache/log/error.log" apache_err_rotsteps="10" apache_err_rotminsize="1M" apache_err_rotcomplevel="9" apache_err_rotprolog="true" apache_err_rotepilog="true" apache_cgi_files="@@l_prefix@@/var/apache/log/script.log" apache_cgi_rotsteps="10" apache_cgi_rotminsize="1M" apache_cgi_rotcomplevel="9" apache_cgi_rotprolog="true" apache_cgi_rotepilog="true" apache_cachesize="10M" %common apache_pidfile="@@l_prefix@@/var/apache/run/apache.pid" apache_cachedir="@@l_prefix@@/var/apache/run/apache.cache" apache_signal () { [ -f $apache_pidfile ] && kill -$1 `cat $apache_pidfile` } %status -u @@l_susr@@ -o apache_usable="no" apache_active="no" @@l_prefix@@/sbin/apache -t 2>/dev/null && apache_usable="yes" rcService apache enable yes && \ apache_signal 0 && apache_active="yes" echo "apache_enable=\"$apache_enable\"" echo "apache_usable=\"$apache_usable\"" echo "apache_active=\"$apache_active\"" %start -u @@l_susr@@ rcService apache enable yes || exit 0 rcService apache active yes && exit 0 ( cd @@l_prefix@@/var/apache/run [ -e @@l_prefix@@/etc/apache/apache.sh ] && . @@l_prefix@@/etc/apache/apache.sh @@l_prefix@@/sbin/apache ) || exit $? %stop -u @@l_susr@@ rcService apache enable yes || exit 0 rcService apache active no && exit 0 @@l_prefix@@/sbin/apache -k stop sleep 2 %restart -u @@l_susr@@ rcService apache enable yes || exit 0 rcService apache active no && exit 0 rc apache stop start %reload -u @@l_susr@@ rcService apache enable yes || exit 0 rcService apache active no && exit 0 @@l_prefix@@/sbin/apache -k graceful %daily -u @@l_susr@@ rcService apache enable yes || exit 0 rcTmp -i hintfile=`rcTmp -f -n hint` shtool rotate -f \ -n ${apache_log_rotsteps} -s ${apache_log_rotminsize} -d \ -z ${apache_log_rotcomplevel} -o @@l_susr@@ -g @@l_mgrp@@ -m 644 \ -P "$apache_log_rotprolog" \ -E "$apache_log_rotepilog; echo 1 >$hintfile" \ ${apache_log_files} shtool rotate -f \ -n ${apache_err_rotsteps} -s ${apache_err_rotminsize} -d \ -z ${apache_err_rotcomplevel} -o @@l_susr@@ -g @@l_mgrp@@ -m 644 \ -P "$apache_err_rotprolog" \ -E "$apache_err_rotepilog; echo 1 >$hintfile" \ ${apache_err_files} shtool rotate -f \ -n ${apache_cgi_rotsteps} -s ${apache_cgi_rotminsize} -d \ -z ${apache_cgi_rotcomplevel} -o @@l_susr@@ -g @@l_mgrp@@ -m 644 \ -P "$apache_cgi_rotprolog" \ -E "$apache_cgi_rotepilog; echo 1 >$hintfile" \ ${apache_cgi_files} if [ ".@@with_mod_filecache@@" = .yes ]; then @@l_prefix@@/sbin/htcacheclean \ -n -t -l "$apache_cachesize" -p "$apache_cachedir" fi if [ -s $hintfile ]; then @@l_prefix@@/sbin/apache -k graceful fi rcTmp -k @ 1.27 log @Expected behavior of the 'restart' target is the same as invoking 'stop'/'start'. Alas, 'apache -k restart' implements just a HUP signal. So we do an explicit 'stop'/'start' here to let Apache pick up major configuration changes like loading of new or updated DSOs. While being here, doing some cosmetics as well @ text @d26 1 d30 1 d92 4 @ 1.26 log @we already check whether apache is already running or not so we don't need to pass '-k start' @ text @d54 1 a54 1 rcService apache active no && exit 0 d60 2 a61 2 rcService apache active no && exit 0 @@l_prefix@@/sbin/apache -k restart d65 1 a65 1 rcService apache active no && exit 0 @ 1.25 log @rotate the script.log, too @ text @d49 1 a49 1 @@l_prefix@@/sbin/apache -k start @ 1.24 log @new OpenPKG world order: upgrade from Apache 1.3 to 2.2 (part 1/3: updated/new packages) @ text @d20 6 d84 6 @ 1.23 log @replace '@@l_prefix@@/lib/openpkg/bash @@l_prefix@@/etc/rc' in shebang with '@@l_prefix@@/bin/openpkg rc' to allow people who run the rc.xxx scripts directly (as executables) to leverage from the Set-UID functionality @ text @d9 5 a13 5 apache_log_prolog="true" apache_log_epilog="true" apache_log_numfiles="10" apache_log_minsize="1M" apache_log_complevel="9" d15 5 a19 11 apache_err_prolog="true" apache_err_epilog="true" apache_err_numfiles="10" apache_err_minsize="1M" apache_err_complevel="9" apache_ssl_files="@@l_prefix@@/var/apache/log/ssl.log" apache_ssl_prolog="true" apache_ssl_epilog="true" apache_ssl_numfiles="10" apache_ssl_minsize="1M" apache_ssl_complevel="9" d41 1 a41 1 [ -e @@l_prefix@@/etc/apache/apache.sh ] && \ d43 1 a43 1 @@l_prefix@@/sbin/apache d48 2 a49 2 rcService apache active no && exit 0 apache_signal TERM a50 1 rm -f $apache_pidfile >/dev/null 2>&1 || true d54 2 a55 5 rcService apache active no && exit 0 @@l_prefix@@/sbin/apache -t || exit $? rc apache stop sleep 4 rc apache start d59 2 a60 3 rcService apache active no && exit 0 @@l_prefix@@/sbin/apache -t || exit $? apache_signal USR1 d64 16 a79 23 if [ ".$apache_log_files" != . ]; then shtool rotate -f \ -n ${apache_log_numfiles} -s ${apache_log_minsize} -d \ -z ${apache_log_complevel} -m 644 -o @@l_susr@@ -g @@l_mgrp@@ \ -P "${apache_log_prolog}" \ -E "${apache_log_epilog} && rc apache reload" \ $apache_log_files fi if [ ".$apache_err_files" != . ]; then shtool rotate -f \ -n ${apache_err_numfiles} -s ${apache_err_minsize} -d \ -z ${apache_err_complevel} -m 644 -o @@l_susr@@ -g @@l_mgrp@@ \ -P "${apache_err_prolog}" \ -E "${apache_err_epilog} && rc apache reload" \ $apache_err_files fi if [ ".$apache_ssl_files" != . ]; then shtool rotate -f \ -n ${apache_ssl_numfiles} -s ${apache_ssl_minsize} -d \ -z ${apache_ssl_complevel} -m 644 -o @@l_susr@@ -g @@l_mgrp@@ \ -P "${apache_ssl_prolog}" \ -E "${apache_ssl_epilog} && rc apache reload" \ $apache_ssl_files d81 1 @ 1.22 log @always switch into the Apache run-time directory as at least PHP with MM based sessions store their session database into the _current working directory_ which was active at the time Apache was started @ text @d1 1 a1 1 #!@@l_prefix@@/lib/openpkg/bash @@l_prefix@@/etc/rc @ 1.21 log @The ssl.log should be also rotated, please. @ text @d46 2 a47 1 ( [ -e @@l_prefix@@/etc/apache/apache.sh ] && \ @ 1.21.2.1 log @MFC: latest fixes plus scurity fixed PHP @ text @d46 1 a46 2 ( cd @@l_prefix@@/var/apache/run [ -e @@l_prefix@@/etc/apache/apache.sh ] && \ @ 1.21.2.2 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @d1 1 a1 1 #!@@l_prefix@@/bin/openpkg rc @ 1.20 log @increase delays on restarts (only) from 2 to 6 in total @ text @d20 6 d90 8 @ 1.19 log @return is only allowed within a function @ text @d56 3 a58 1 rc apache stop start @ 1.18 log @do not %restart or %reload if the Apache configuration got broken (in the meantime) and do a graceful restart in %reload, because for a non-graceful we have %restart anyway @ text @d43 1 a43 1 ) || return $? @ 1.18.4.1 log @MFC: fix %start: s/return/exit/ @ text @d43 1 a43 1 ) || exit $? @ 1.17 log @fixed rc script @ text @d55 1 d61 2 a62 1 apache_signal HUP a65 1 a66 1 # rotate logfile a73 1 a74 1 # rotate errfile @ 1.17.4.1 log @MFC: pdflib build problems; graceful restarts; config checking @ text @a54 1 @@l_prefix@@/sbin/apache -t || exit $? d60 1 a60 2 @@l_prefix@@/sbin/apache -t || exit $? apache_signal USR1 d64 1 d66 1 d74 1 d76 1 @ 1.16 log @added shell environment script @ text @d22 4 a25 1 . @@l_prefix@@/etc/apache/apache.sh d30 3 a32 4 @@l_prefix@@/sbin/apachectl configtest 2>/dev/null && apache_usable="yes" ( eval `grep "^PIDFILE=" @@l_prefix@@/sbin/apachectl` [ ".$PIDFILE" != . -a -f "$PIDFILE" ] && kill -0 `cat $PIDFILE` ) && apache_active="yes" d40 4 a43 1 @@l_prefix@@/sbin/apachectl start d48 1 a48 1 @@l_prefix@@/sbin/apachectl stop d50 1 d55 6 a60 1 @@l_prefix@@/sbin/apachectl restart d71 1 a71 1 -E "${apache_log_epilog} && rc apache restart" \ d81 1 a81 1 -E "${apache_err_epilog} && rc apache restart" \ @ 1.15 log @PR#202 run-time check and related issues @ text @d21 3 @ 1.14 log @cleanup the priority: move 200 to 500 and because 500 is default just ommit it; fix DNS/NTP/etc. dependencies @ text @d9 5 a13 5 apache_log_rotsteps="10" apache_log_rotminsize="10M" apache_log_rotcomplevel="9" apache_log_rotprolog="true" apache_log_rotepilog="true" d15 5 a19 5 apache_err_rotsteps="10" apache_err_rotminsize="1M" apache_err_rotcomplevel="9" apache_err_rotprolog="true" apache_err_rotepilog="true" d34 1 d39 1 d45 1 d50 1 d52 1 d54 4 a57 4 -n ${apache_log_rotsteps} -s ${apache_log_rotminsize} -d \ -z ${apache_log_rotcomplevel} -o @@l_musr@@ -g @@l_mgrp@@ -m 644 \ -P "$apache_log_rotprolog" \ -E "@@l_prefix@@/sbin/apachectl restart; $apache_log_rotepilog" \ d60 1 d62 1 d64 4 a67 4 -n ${apache_err_rotsteps} -s ${apache_err_rotminsize} -d \ -z ${apache_err_rotcomplevel} -o @@l_musr@@ -g @@l_mgrp@@ -m 644 \ -P "$apache_err_rotprolog" \ -E "@@l_prefix@@/sbin/apachectl restart; $apache_err_rotepilog" \ @ 1.13 log @PR#210: shtool options space before argument @ text @d21 1 a21 1 %status -p 200 -u @@l_susr@@ -o d32 1 a32 1 %start -p 200 -u @@l_susr@@ d36 1 a36 1 %stop -p 200 -u @@l_susr@@ @ 1.12 log @replace opXXXX with rcXXXX (PR#207) @ text @d49 2 a50 2 -n${apache_log_rotsteps} -s${apache_log_rotminsize} -d \ -z${apache_log_rotcomplevel} -o@@l_musr@@ -g@@l_mgrp@@ -m644 \ d57 2 a58 2 -n${apache_err_rotsteps} -s${apache_err_rotminsize} -d \ -z${apache_err_rotcomplevel} -o@@l_musr@@ -g@@l_mgrp@@ -m644 \ @ 1.11 log @migrate opServiceEnabled to opService ... enable yes; use new bootstrap feature and apply opService short circuit to %env @ text @d33 1 a33 1 opService apache enable yes || exit 0 d37 1 a37 1 opService apache enable yes || exit 0 d42 1 a42 1 opService apache enable yes || exit 0 d46 1 a46 1 opService apache enable yes || exit 0 @ 1.10 log @%status @ text @d33 1 a33 1 opServiceEnabled apache || exit 0 d37 1 a37 1 opServiceEnabled apache || exit 0 d42 1 a42 1 opServiceEnabled apache || exit 0 d46 1 a46 1 opServiceEnabled apache || exit 0 @ 1.9 log @use new openpkg_rc_def variable in run-command scripts for allowing the admin to change the global default for xxx_enable @ text @d21 11 @ 1.8 log @cosmetics: align/fix/unify rc header comment @ text @d7 1 a7 1 apache_enable="yes" @ 1.7 log @rc script clean up @ text @d3 1 a3 1 ## rc.apache -- Apache Administration Run-Commands @ 1.6 log @Switch to l_{s,m,r,n}{usr,grp}. @ text @d21 1 a21 1 %start -p 200 -u root d25 1 a25 1 %stop -p 200 -u root d30 1 a30 1 %restart -u root d34 1 a34 1 %daily -u root @ 1.6.4.1 log @mass Merge-From-CURRENT (MFC) in preparation for OpenPKG 1.3 [class BASE only] @ text @d3 1 a3 1 ## rc.apache -- Run-Commands d7 1 a7 1 apache_enable="$openpkg_rc_def" d9 5 a13 5 apache_log_prolog="true" apache_log_epilog="true" apache_log_numfiles="10" apache_log_minsize="1M" apache_log_complevel="9" d15 5 a19 5 apache_err_prolog="true" apache_err_epilog="true" apache_err_numfiles="10" apache_err_minsize="1M" apache_err_complevel="9" d21 2 a22 14 %status -u @@l_susr@@ -o apache_usable="no" apache_active="no" @@l_prefix@@/sbin/apachectl configtest 2>/dev/null && apache_usable="yes" ( eval `grep "^PIDFILE=" @@l_prefix@@/sbin/apachectl` [ ".$PIDFILE" != . -a -f "$PIDFILE" ] && kill -0 `cat $PIDFILE` ) && apache_active="yes" echo "apache_enable=\"$apache_enable\"" echo "apache_usable=\"$apache_usable\"" echo "apache_active=\"$apache_active\"" %start -u @@l_susr@@ rcService apache enable yes || exit 0 rcService apache active yes && exit 0 d25 2 a26 3 %stop -u @@l_susr@@ rcService apache enable yes || exit 0 rcService apache active no && exit 0 d30 2 a31 3 %restart -u @@l_susr@@ rcService apache enable yes || exit 0 rcService apache active no && exit 0 d34 2 a35 3 %daily -u @@l_susr@@ rcService apache enable yes || exit 0 a36 1 # rotate logfile d38 4 a41 4 -n ${apache_log_numfiles} -s ${apache_log_minsize} -d \ -z ${apache_log_complevel} -m 644 -o @@l_susr@@ -g @@l_mgrp@@ \ -P "${apache_log_prolog}" \ -E "${apache_log_epilog} && rc apache restart" \ a43 1 a44 1 # rotate errfile d46 4 a49 4 -n ${apache_err_numfiles} -s ${apache_err_minsize} -d \ -z ${apache_err_complevel} -m 644 -o @@l_susr@@ -g @@l_mgrp@@ \ -P "${apache_err_prolog}" \ -E "${apache_err_epilog} && rc apache restart" \ @ 1.5 log @fixed log file rotation group ownership @ text @d39 1 a39 1 -z${apache_log_rotcomplevel} -o@@l_fsusr@@ -g@@l_fsgrp@@ -m644 \ d47 1 a47 1 -z${apache_err_rotcomplevel} -o@@l_fsusr@@ -g@@l_fsgrp@@ -m644 \ @ 1.4 log @fixed log file rotation group ownership @ text @d47 1 a47 1 -z${apache_err_rotcomplevel} -o@@l_fsusr@@ -o@@l_fsgrp@@ -m644 \ @ 1.3 log @Mega-change: - prefix/etc/rpm -> prefix/etc/openpkg - prefix/lib/rpm -> prefix/lib/openpkg @ text @d39 1 a39 1 -z${apache_log_rotcomplevel} -o@@l_fsusr@@ -o@@l_fsgrp@@ -m644 \ @ 1.2 log @Fix rc-script. Backslashes were missing. PR: 9 Submitted by: Christoph Schug @ text @d1 1 a1 1 #!@@l_prefix@@/lib/rpm/bash @@l_prefix@@/etc/rc @ 1.1 log @Initial revision @ text @d38 1 a38 1 -n${apache_log_rotsteps} -s${apache_log_rotminsize} -d d46 1 a46 1 -n${apache_err_rotsteps} -s${apache_err_rotminsize} -d @ 1.1.1.1 log @Import OpenPKG sources into CVS repository @ text @@