Current time: 04-19-2024, 09:17 AM Hello There, Guest! (LoginRegister)


Post Reply 
Gentoo upgrade bugs
Author Message
ZiomekPL Offline
Junior Member
*

Posts: 20
Joined: Apr 2010
Reputation: 0
Post: #1
Gentoo upgrade bugs
I upgrading ispCP 1.0.4->1.0.7RC1 on Gentoo
I found 2 bugs in scripts:

1. /etc/init.d/ispcp_network in last line has 'exit 0' and this bloking any actions on daemon. (doesnt start or stop) and causes iptables errors.
(this line shuld be removed)

2. in ispcp-serv-mngr line ($rs, $stdErr) = sys_command_stderr("$main::cfg{'CMD_HTTPD'} graceful"); working fine, but before upgrade ispcp-upgrade stopping all services and on stopped apache graceful reload isnt possible and quiting which error status, and broking upgrade. (apache shuld be running during upgrade?)

edit: 3. if we got something like that:
"PWD
550 PWD: Permission denied"

we shuld change in /etc/proftpd/proftpd.conf line: HideNoAccess on
to
HideNoAccess off

4. - Fatal: unknown configuration directive 'IdentLookups' on line 46 of '/etc/proftpd/proftpd.conf'
this line shuld be commented
(This post was last modified: 09-21-2010 10:38 PM by ZiomekPL.)
09-21-2010 09:29 PM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #2
RE: Gentoo upgrade bugs
Hello ;

1. Normally, the exit code should don't pose any problem.

2. Yes, during update process, all services are shutting down at the begin and are restarted at the end. More info please.

3 and 4: Patch please.
09-22-2010 03:50 AM
Quote this message in a reply
ZiomekPL Offline
Junior Member
*

Posts: 20
Joined: Apr 2010
Reputation: 0
Post: #3
RE: Gentoo upgrade bugs
1. init calling init script and creating functions start stop etc. 'exit 0' exiting before functions start or stop was called

2.
Code:
20:17:15 [511] viper-hosting ispcp # apache2ctl graceful
* Gracefully restarting apache2 ...       [ ok ]
20:17:27 [512] viper-hosting ispcp # echo $?
0
20:17:34 [513] viper-hosting ispcp # /etc/init.d/apache2 stop
* Stopping apache2 ...          [ ok ]
20:17:45 [514] viper-hosting ispcp # apache2ctl graceful
20:17:48 [515] viper-hosting ispcp # echo $?
1
20:17:50 [516] viper-hosting ispcp #

3 and 4:
Code:
--- proftpd.conf.old    2010-09-21 20:19:31.000000000 +0200
+++ proftpd.conf        2010-09-21 14:33:44.000000000 +0200
@@ -43,7 +43,7 @@

AllowOverwrite             on
UseReverseDNS              off
-IdentLookups               off
+#IdentLookups               off
AllowStoreRestart          on
AllowForeignAddress        on

@@ -94,7 +94,7 @@
   Umask                    022  022
   # Normally, we want files to be overwriteable.
   AllowOverwrite           on
-  HideNoAccess             on
+  HideNoAccess             off
</Directory>

<Limit ALL>
09-22-2010 04:20 AM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #4
RE: Gentoo upgrade bugs
Re ;

Ok, I understand now. Thanks for the patch.
http://isp-control.net/ispcp/ticket/2472
09-22-2010 04:24 AM
Quote this message in a reply
Nuxwin
Unregistered

 
Post: #5
RE: Gentoo upgrade bugs
re ;

What is the status code for apache2ctl configtest ?
09-22-2010 07:40 AM
Quote this message in a reply
ZiomekPL Offline
Junior Member
*

Posts: 20
Joined: Apr 2010
Reputation: 0
Post: #6
RE: Gentoo upgrade bugs
0 if config is ok -- always
09-22-2010 08:05 AM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #7
RE: Gentoo upgrade bugs
Graceful (SIGUSR1) is hard coded into apache to start server if is not running. Must be some kind of error on your server or gentoo bug.
09-23-2010 04:56 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiomekPL Offline
Junior Member
*

Posts: 20
Joined: Apr 2010
Reputation: 0
Post: #8
RE: Gentoo upgrade bugs
Code:
11:47:36 [6] viper-hosting ~ # cat /usr/sbin/apache2ctl
#!/bin/sh
exec /etc/init.d/apache2 "$@"
11:47:45 [7] viper-hosting ~ # cat /etc/init.d/apache2
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

opts="configdump configtest fullstatus graceful gracefulstop modules reload virtualhosts"

depend() {
        need net
        use mysql dns logger netmount postgresql
        after sshd
}

configtest() {
        ebegin "Checking ${SVCNAME} configuration"
        checkconfig
        eend $?
}

checkconfd() {
        PIDFILE="${PIDFILE:-/var/run/apache2.pid}"
        TIMEOUT=${TIMEOUT:-10}

        SERVERROOT="${SERVERROOT:-/usr/lib64/apache2}"
        if [ ! -d ${SERVERROOT} ]; then
                eerror "SERVERROOT does not exist: ${SERVERROOT}"
                return 1
        fi

        CONFIGFILE="${CONFIGFILE:-/etc/apache2/httpd.conf}"
        [ "${CONFIGFILE#/}" = "${CONFIGFILE}" ] && CONFIGFILE="${SERVERROOT}/${CONFIGFILE}"
        if [ ! -r "${CONFIGFILE}" ]; then
                eerror "Unable to read configuration file: ${CONFIGFILE}"
                return 1
        fi

        APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}"
        APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}"
        [ -n "${STARTUPERRORLOG}" ] && APACHE2_OPTS="${APACHE2_OPTS} -E ${STARTUPERRORLOG}"

        APACHE2="/usr/sbin/apache2"
}

checkconfig() {
        checkconfd || return 1

        ${APACHE2} ${APACHE2_OPTS} -t 1>/dev/null 2>&1
        ret=$?
        if [ $ret -ne 0 ]; then
                eerror "${SVCNAME} has detected an error in your setup:"
                ${APACHE2} ${APACHE2_OPTS} -t
        fi

        return $ret
}

start() {
        checkconfig || return 1

        [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache

        ebegin "Starting ${SVCNAME}"
        ${APACHE2} ${APACHE2_OPTS} -k start

        i=0
        while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
                sleep 1 && i=$(expr $i + 1)
        done

        test $i -le ${TIMEOUT}
        eend $?
}

stop() {
        checkconfd || return 1

        ebegin "Stopping ${SVCNAME}"
        ${APACHE2} ${APACHE2_OPTS} -k stop

        i=0
        while pidof "${APACHE2}" >/dev/null && [ $i -lt ${TIMEOUT} ]; do
                sleep 1 && i=$(expr $i + 1)
        done

        test $i -le ${TIMEOUT}
        eend $?
}

reload() {
        RELOAD_TYPE="${RELOAD_TYPE:-graceful}"

        checkconfig || return 1
        service_started "${SVCNAME}" || return

        if [ "${RELOAD_TYPE}" = "restart" ]; then
                ebegin "Restarting ${SVCNAME}"
                ${APACHE2} ${APACHE2_OPTS} -k restart
                eend $?
        elif [ "${RELOAD_TYPE}" = "graceful" ]; then
                ebegin "Gracefully restarting ${SVCNAME}"
                ${APACHE2} ${APACHE2_OPTS} -k graceful
                eend $?
        else
                eerror "${RELOAD_TYPE} is not a valid RELOAD_TYPE. Please edit /etc/conf.d/${SVCNAME}"
        fi
}

graceful() {
        checkconfig || return 1
        service_started "${SVCNAME}" || return
        ebegin "Gracefully restarting ${SVCNAME}"
        ${APACHE2} ${APACHE2_OPTS} -k graceful
        eend $?
}

gracefulstop() {
        checkconfig || return 1

        # zap!
        if service_started "${SVCNAME}"; then
                mark_service_stopped "${SVCNAME}"
        fi

        ebegin "Gracefully stopping ${SVCNAME}"
        ${APACHE2} ${APACHE2_OPTS} -k graceful-stop
        eend $?
}

modules() {
        checkconfig || return 1

        ${APACHE2} ${APACHE2_OPTS} -M 2>&1
}

fullstatus() {
        LYNX="${LYNX:-lynx -dump}"
        STATUSURL="${STATUSURL:-http://localhost/server-status}"

        if ! service_started "${SVCNAME}"; then
                eerror "${SVCNAME} not started"
        elif ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
                eerror "lynx not found! you need to emerge www-client/lynx"
        else
                ${LYNX} ${STATUSURL}
        fi
}

virtualhosts() {
        checkconfd || return 1
        ${APACHE2} ${APACHE2_OPTS} -S
}

configdump() {
        LYNX="${LYNX:-lynx -dump}"
        INFOURL="${INFOURL:-http://localhost/server-info}"

        checkconfd || return 1

        if ! service_started "${SVCNAME}"; then
                eerror "${SVCNAME} not started"
        elif ! type -p $(set -- ${LYNX}; echo $1) 2>&1 >/dev/null; then
                eerror "lynx not found! you need to emerge www-client/lynx"
        else
                echo "${APACHE2} started with '${APACHE2_OPTS}'"
                for i in config server list; do
                        ${LYNX} "${INFOURL}/?${i}" | sed '/Apache Server Information/d;/^[[:space:]]\+[_]\+$/Q'
                done
        fi
}

# vim: ts=4 filetype=gentoo-init-d
11:47:53 [8] viper-hosting ~ #
Code:
graceful() {
        checkconfig || return 1
        service_started "${SVCNAME}" || return
        ebegin "Gracefully restarting ${SVCNAME}"
        ${APACHE2} ${APACHE2_OPTS} -k graceful
        eend $?
}
09-26-2010 07:48 PM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #9
RE: Gentoo upgrade bugs
this is wrong:
Quote:service_started "${SVCNAME}" || return
I do not know why gentoo do not let apache process this (maybe should be considered as an gentoo bug?). Anyway, please open a bug in our traker, we should use SIGUSR1 on pid to avoid fancy distros interfere with apache restarting. And until is fixed you can safely comment this line
(This post was last modified: 09-26-2010 08:06 PM by sci2tech.)
09-26-2010 08:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiomekPL Offline
Junior Member
*

Posts: 20
Joined: Apr 2010
Reputation: 0
Post: #10
RE: Gentoo upgrade bugs
I know Smile
I fixet it in ispcp perl script (init.d files can be replaced after system upgrade, and this bug is present only during upgrade)
09-26-2010 10:31 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)