Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 255431

Summary: sys-power/pm-utils-1.2.3: patch for adapting "stopservice" function to Gentoo
Product: Gentoo Linux Reporter: Pacho Ramos <pacho>
Component: Current packagesAssignee: Freedesktop bugs <freedesktop-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://lists.freedesktop.org/archives/pm-utils/2009-January/001866.html
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: pm-utils-1.2.3-functions.patch

Description Pacho Ramos gentoo-dev 2009-01-18 20:25:47 UTC
I have been already discussed about this in upstream mailling list and attached patch (from it) seems to work fine. It simply prepares "servicerestart" function for looking for "started" instead of "running" when running /etc/init.d/* status

Thanks a lot :-)

Reproducible: Always
Comment 1 Pacho Ramos gentoo-dev 2009-01-18 20:26:10 UTC
Created attachment 178922 [details, diff]
pm-utils-1.2.3-functions.patch
Comment 2 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-01-18 20:30:37 UTC
what does it fix exactly ?
Comment 3 Pacho Ramos gentoo-dev 2009-01-18 20:38:40 UTC
Sorry for the unproper description

I have done a quirk for restarting hdparm service when resuming from hibernate/suspend. I tried to use "stopservice" and "restartservice" functions from /usr/lib/pm-utils/functions, the problem is that current stopservice functions looks like the following:
        if service "$1" status 2>/dev/null | grep -c -q running; then
                touch "${STORAGEDIR}/service:$1"
                service "$1" stop
        fi

It searches for "running", but, under Gentoo (at least with baselayout-1, I don't know with -2), status reports "started" instead

The attached patch will make it look for both outputs (upstream is already aware of this http://lists.freedesktop.org/archives/pm-utils/2009-January/001866.html , and, as read just now, they have already accepted it :-))

This way, function will exit properly and work as expected :-)

Regards
Comment 4 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-01-18 20:53:47 UTC
added to 1.2.3-r1. Thanks for reporting.