Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 242578 - sys-apps/preload-0.6.3: warnings when restarting preload service
Summary: sys-apps/preload-0.6.3: warnings when restarting preload service
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Jeremy Olexa (darkside) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-18 15:20 UTC by Pacho Ramos
Modified: 2008-10-23 17:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2008-10-18 15:20:30 UTC
When I restart preload I get:
 * Please use 'svc_stop; svc_start' and not 'stop; start' to
 * restart the service in its custom 'restart()' function.
 * Run preload without arguments for more info.

 * Stopping preload ...                                                                                                                                [ ok ]
 * Starting preload ...                                                                                                                                [ ok ]

Seems that the function in init.d file is the following:
restart() {
    ebegin "Reloading config for preload"
    killall -SIGHUP /usr/sbin/preload
    eend $?
}

But I don't know why this seems to be not recommended and it should look something like (I HAVEN'T TRIED IT YET):
restart() {
    ebegin "Reloading config for preload"
    svc_stop
    svc_start
    eend $?
}

Regards

Reproducible: Always
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-10-20 15:14:11 UTC
Maybe we should just remove the whole restart() function? I removed it locally and it seems to work just as well.

To be honest, I don't see any errors the way it is now either. (And I don't know what svc_start/stop is)
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-10-20 16:39:57 UTC
Additionally, I can't decide if bug 242442 is blocking this one or not.
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-10-20 16:41:16 UTC
(In reply to comment #2)
> Additionally, I can't decide if bug 242442 is blocking this one or not.
> 

Bah, s/242442/241884/

Bug 241884, is the bug I meant to reference.
Comment 4 Pacho Ramos gentoo-dev 2008-10-20 21:21:45 UTC
I get this message in all machines I have tried, seems that it comes from runscript.sh:

        # Simple way to try and detect if the service use svc_{start,stop}
        # to restart if it have a custom restart() funtion.
        if [[ -n $(egrep '^[[:space:]]*restart[[:space:]]*()' "/etc/init.d/${SVCNAME}") ]] ; then
                if [[ -z $(egrep 'svc_stop' "/etc/init.d/${SVCNAME}") || \
                        -z $(egrep 'svc_start' "/etc/init.d/${SVCNAME}") ]] ; then
                        echo
                        ewarn "Please use 'svc_stop; svc_start' and not 'stop; start' to"
                        ewarn "restart the service in its custom 'restart()' function."
                        ewarn "Run ${SVCNAME} without arguments for more info."
                        echo
                        if ! service_stopped "${SVCNAME}" ; then
                                svc_stop || return "$?"
                        fi
                        svc_start
                else
                        restart
                fi
        else
                restart
        fi


But I have no idea about if it's blocking or not 241884, sorry (I am still using stable baselayout and I don't have openrc)
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-10-23 15:26:33 UTC
hmm, I just put init changes in for -r3 but stable portage users won't get that. So, remerge -r1 to get the changes or look here:
http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/
Comment 6 Pacho Ramos gentoo-dev 2008-10-23 17:43:49 UTC
Thanks, seems to work fine :-)