summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--2.4/init/apache2.confd4
-rwxr-xr-x2.4/init/apache2.initd7
-rw-r--r--2.4/scripts/apache2-logrotate8
-rwxr-xr-xrolltarball.sh108
4 files changed, 50 insertions, 77 deletions
diff --git a/2.4/init/apache2.confd b/2.4/init/apache2.confd
index 4635201..e6bb6c2 100644
--- a/2.4/init/apache2.confd
+++ b/2.4/init/apache2.confd
@@ -41,7 +41,9 @@ APACHE2_OPTS="-D DEFAULT_VHOST -D LANGUAGE -D INFO"
# via them will result in Apache failing to start
# YOU HAVE BEEN WARNED.
-# PID file
+# PID file.
+# You need to set "PidFile" in httpd.conf as well if you change this from the
+# default (which is /var/run/apache2.pid)
#PIDFILE=/var/run/apache2.pid
# timeout for startup/shutdown checks
diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd
index e834b44..fc09ddd 100755
--- a/2.4/init/apache2.initd
+++ b/2.4/init/apache2.initd
@@ -37,9 +37,9 @@ depend() {
after sshd
if ! echo ${rc_need} | grep -Fq "net." ; then
local x warn_addr
- for x in $(virtualhosts | grep '^\(\[\|\*:\|\)[[:digit:]]' | sed 's@\(:[[:digit:]]\{1,5\}\)\([[:space:]].*\|$\)@\1@' | sort -u) ; do
+ for x in $(virtualhosts 2>/dev/null | grep '^\(\[\|\*:\|\)[[:digit:]]' | sed 's@\(:[[:digit:]]\{1,5\}\)\([[:space:]].*\|$\)@\1@' | sort -u) ; do
case "${x}" in
- \*:80|\*.443) ;;
+ \*:80|\*:443) ;;
*) warn_addr="${warn_addr} ${x}" ;;
esac
done
@@ -92,7 +92,8 @@ start() {
ebegin "Starting ${SVCNAME}"
# Use start stop daemon to apply system limits #347301
- start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start
+ start-stop-daemon --start --pidfile "${PIDFILE}" -- \
+ ${APACHE2} ${APACHE2_OPTS} -k start
local i=0 retval=1
while [ $i -lt ${TIMEOUT} ] ; do
diff --git a/2.4/scripts/apache2-logrotate b/2.4/scripts/apache2-logrotate
index 9dd431c..5d9f8dc 100644
--- a/2.4/scripts/apache2-logrotate
+++ b/2.4/scripts/apache2-logrotate
@@ -1,11 +1,15 @@
# Apache2 logrotate snipet for Gentoo Linux
-# Contributes by Chuck Short
+# Originally contributed by Chuck Short
#
/var/log/apache2/*log {
missingok
notifempty
sharedscripts
postrotate
- /etc/init.d/apache2 reload > /dev/null 2>&1 || true
+ if test -d /run/systemd/system ; then
+ systemctl reload apache2.service > /dev/null 2>&1 || true
+ else
+ /etc/init.d/apache2 reload > /dev/null 2>&1 || true
+ fi
endscript
}
diff --git a/rolltarball.sh b/rolltarball.sh
index 1962c00..8852ca2 100755
--- a/rolltarball.sh
+++ b/rolltarball.sh
@@ -22,14 +22,13 @@
# Please increase version number before each commit which includes changes to
# this script.
-MYVERSION='2.0'
+MYVERSION='2.2'
# ********** Begin functions **********
usage() {
- if [ -n "$1" ]
- then
+ if [[ -n "$1" ]] ; then
eerror $1
else
cat <<-USAGE_HEADER
@@ -91,8 +90,7 @@ eerror() {
die() {
- if [ "$#" -gt 0 ]
- then
+ if [[ "$#" -gt 0 ]] ; then
eerror ${*}
fi
exit 1
@@ -100,16 +98,14 @@ die() {
einfo() {
- if [ "${VERBOSE}" -ge "1" ]
- then
+ if [[ "${VERBOSE}" -ge "1" ]] ; then
echo -e " ${GOOD}*${NORMAL} ${*}"
fi
}
ebegin() {
- if [ "${VERBOSE}" -ge "1" ]
- then
+ if [[ "${VERBOSE}" -ge "1" ]] ; then
echo -e " ${GOOD}*${NORMAL} ${*}..."
fi
}
@@ -117,22 +113,18 @@ ebegin() {
eend() {
- if [ "$#" -eq 0 ] || ([ -n "$1" ] && [ "$1" -eq 0 ])
- then
- if [ "${VERBOSE}" -ge "1" ]
- then
+ if [[ "$#" -eq 0 ]] || { [[ -n "$1" ]] && [[ "$1" -eq 0 ]] ; } ; then
+ if [[ "${VERBOSE}" -ge "1" ]] ; then
echo -e "${ENDCOL} ${BRACKET}[ ${GOOD}ok${BRACKET} ]${NORMAL}"
fi
else
retval=$1
- if [ "$#" -ge 2 ]
- then
+ if [[ "$#" -ge 2 ]] ; then
shift
eerror "${*}"
fi
- if [ "${VERBOSE}" -ge "1" ]
- then
+ if [[ "${VERBOSE}" -ge "1" ]] ; then
echo -e "${ENDCOL} ${BRACKET}[ ${BAD}!!${BRACKET} ]${NORMAL}"
fi
return ${retval}
@@ -142,16 +134,14 @@ eend() {
ewarn() {
- if [ "${VERBOSE}" -ge "2" ]
- then
+ if [[ "${VERBOSE}" -ge "2" ]] ; then
echo -e " ${WARN}*${NORMAL} ${*}"
fi
}
edebug() {
- if [ "${VERBOSE}" -ge "4" ]
- then
+ if [[ "${VERBOSE}" -ge "4" ]] ; then
echo -e " ${HILITE}*${NORMAL} ${*}"
fi
}
@@ -202,22 +192,19 @@ UPLOAD_MIRROR=0
VERBOSE=1
# load configuration
-if [ -e ~/.apache-rolltarball ]
-then
+if [[ -e ~/.apache-rolltarball ]] ; then
. ~/.apache-rolltarball
edebug "Loaded configuration from ~/.apache-rolltarball"
fi
-if [ "${COLOR}" -eq "0" ]
-then
+if [[ "${COLOR}" -eq "0" ]] ; then
nocolor;
else
color;
fi
# Process command line
-until [ -z "$1" ]
-do
+until [[ -z "$1" ]] ; do
case "$1" in
--*)
# long options
@@ -233,7 +220,7 @@ do
no-copy) COPYTO=;;
datestamp) DATESTAMP=${VALUE};;
devspace) UPLOAD_DEV=1;;
- no-devspace) UPLOAD_DEV=0;;
+ no-devspace) UPLOAD_DEV=0;;
digest) DIGEST=1;;
no-digest) DIGEST=0;;
ebuild) MOD_EBUILD=1;;
@@ -255,8 +242,7 @@ do
# short options
OPTLIST=${1/-/}
shift
- while [ -n "${OPTLIST}" ]
- do
+ while [[ -n "${OPTLIST}" ]] ; do
OPT=${OPTLIST:0:1}
OPTLIST=${OPTLIST#?}
case "${OPT}" in
@@ -287,8 +273,7 @@ do
done
;;
*)
- if [ -n "${EBUILD}" ]
- then
+ if [[ -n "${EBUILD}" ]] ; then
usage "Only one ebuild can be specified"
else
EBUILD=$1
@@ -298,33 +283,27 @@ do
esac
done
-if [ -z "${EBUILD}" ]
-then
+if [[ -z "${EBUILD}" ]] ; then
usage "You must specify an ebuild"
fi
-if [ "${EBUILD##*.}" != "ebuild" ]
-then
+if [[ "${EBUILD##*.}" != "ebuild" ]] ; then
usage "You must specify an ebuild"
fi
-if [ ! -f ${EBUILD} ]
-then
+if [[ ! -f ${EBUILD} ]] ; then
die "Ebuild ${EBUILD} does not exist or is not a file"
fi
-if [ "${VERBOSE}" -lt "0" ]
-then
+if [[ "${VERBOSE}" -lt "0" ]] ; then
VERBOSE=0
fi
-if [ "${VERBOSE}" -gt "4" ]
-then
+if [[ "${VERBOSE}" -gt "4" ]] ; then
VERBOSE=4
fi
-if [ "${VERBOSE}" -ge "3" ]
-then
+if [[ "${VERBOSE}" -ge "3" ]] ; then
edebug "Program output enabled"
exec 9>&1
else
@@ -332,14 +311,12 @@ else
exec 9>/dev/null
fi
-if [ "${ASK}" -eq "1" ]
-then
+if [[ "${ASK}" -eq "1" ]] ; then
PRETEND=1
fi
-if [ -z "${G_USER}" ]
-then
- G_USER="$(git log -1 | grep ^Author | sed 's&.*<\([[:alnum:]\._-]\+\)@.*>&\1&')"
+if [[ -z "${G_USER}" ]] ; then
+ G_USER="$(git log --pretty=fuller -1 | sed -n '/^Commit:/s&.*<\([[:alnum:]\._-]\+\)@.*>&\1&p')"
einfo "Detected Gentoo Developer: ${G_USER}"
fi
@@ -363,8 +340,7 @@ git pull >&9
eend $? "git update failed!" || die
new_mtime=$(stat --format=%Y $0)
-if [ "${my_mtime}" -ne "${new_mtime}" ]
-then
+if [[ "${my_mtime}" -ne "${new_mtime}" ]] ; then
einfo "A new version of $0 is available"
einfo "Please restart $0"
die
@@ -406,8 +382,7 @@ edebug " TB_DIR: ${TB_DIR}"
# simply returns true or false based on whether we are in pretend mod or not
pretend() {
- if [ "${PRETEND}" -eq 1 ]
- then
+ if [[ "${PRETEND}" -eq 1 ]] ; then
true
return $?
else
@@ -440,10 +415,8 @@ build_tarball() {
rm -rf ${TB_DIR} || ewarn "Couldn't clean up, manually remove ${TB_DIR}/"
}
- if [ -n "${COPYTO}" ]
- then
- if [ -d ${COPYTO} -a -w ${COPYTO} ]
- then
+ if [[ -n "${COPYTO}" ]] ; then
+ if [[ -d ${COPYTO} ]] && [[ -w ${COPYTO} ]] ; then
pretend && einfo " Copy ${TB} to ${COPYTO}"
pretend || {
ebegin "Copying ${TB} to ${COPYTO}"
@@ -457,8 +430,7 @@ build_tarball() {
edebug "Copy not enabled"
fi
- if [ "${UPLOAD_DEV}" -eq 1 ]
- then
+ if [[ "${UPLOAD_DEV}" -eq 1 ]] ; then
pretend && einfo " Upload ${TB} to"
pretend && einfo " http://dev.gentoo.org/~${G_USER}/dist/apache/"
pretend || {
@@ -477,8 +449,7 @@ build_tarball() {
edebug "Upload to devspace not enabled"
fi
- if [ "${UPLOAD_MIRROR}" -eq 1 ]
- then
+ if [[ "${UPLOAD_MIRROR}" -eq 1 ]] ; then
pretend && einfo " Upload ${TB} to mirror://gentoo/"
pretend || {
ebegin "Uploading ${TB} to mirror://gentoo/"
@@ -494,10 +465,8 @@ build_tarball() {
edebug "Upload to mirrors not enabled"
fi
- if [ "${MOD_EBUILD}" -eq 1 ]
- then
- if [ -r ${EBUILD} ]
- then
+ if [[ "${MOD_EBUILD}" -eq 1 ]] ; then
+ if [[ -r ${EBUILD} ]] ; then
pretend && einfo " Update GENTOO_PATCHSTAMP, GENTOO_DEVELOPER and GENTOO_PATCHNAME"
pretend || {
ebegin "Updating GENTOO_PATCHSTAMP, GENTOO_DEVELOPER and GENTOO_PATCHNAME"
@@ -517,8 +486,7 @@ build_tarball() {
edebug "Modify ebuild not enabled"
fi
- if [ "${DIGEST}" -eq 1 ]
- then
+ if [[ "${DIGEST}" -eq 1 ]] ; then
pretend && einfo " Regenerate digests"
pretend || {
ebegin "Regenerating digests"
@@ -530,13 +498,11 @@ build_tarball() {
fi
pretend && einfo "No actions actually taken"
- if [ "${ASK}" -eq 1 ]
- then
+ if [[ "${ASK}" -eq 1 ]] ; then
einfo "Would you like to perform the above actions?"
echo -n "Type 'Yes' or 'No'> "
read ask_in
- if [ "${ask_in}" == "Yes" -o "${ask_in}" == "yes" ]
- then
+ if [[ "${ask_in}" == [Yy]es ]] ; then
ASK=0
PRETEND=0
build_tarball