Bug 140512 - hibernate-script: false initscript startup failure on updated systems
Bug#: 140512 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: phreak@gentoo.org Reported By: Marek.Szuba@if.pw.edu.pl
Component: Ebuilds
URL: 
Summary: hibernate-script: false initscript startup failure on updated systems
Keywords:  
Status Whiteboard: 
Opened: 2006-07-15 09:41 0000
Description:   Opened: 2006-07-15 09:41 0000
I'm not exactly sure what caused this to happen, but about two days ago the
initscript from sys-power/hibernate-script (version 1.91, later on reproduced
with 1.93) began to report a startup failure.

What happens was:
 - the first function in the start block checks swap partitions. This part
works fine, invalidating my suspend images as it should;
 - the second function in the block checks for images stored in files. There is
a special file which must exist if there is such an image present and the block
does a "[ -f file ] || return" to check for it. I don't use image files, so it
returns here; however, although as far as I can say the script itself hasn't
changed for quite a while, on my up-to-date system the aforementioned test line
sets the return value to 1.
 - the final line of the script is the Gentoo-specific "eend $?', which sees
the 1 from above and throws an error.

It is quite easy to see the problem is caused by passing an inherited return
value from the second function instead of signalling "nothing to do here, but
everything is fine". The upstream initscript could get away with this because
it doesn't check the return value, but in our case it definitely should be
controlled. The attached patch forces the function to return zero if this test
fails.

------- Comment #1 From Marek Szuba 2006-07-15 09:42:33 0000 -------
Created an attachment (id=91793) [details]
hibernate-script-1.93-fwreturn.patch

------- Comment #2 From Christian Heim (RETIRED) 2006-07-15 13:16:26 0000 -------
Fixed in CVS! Thanks a lot. Please reopen the bugs, if you're still having this
issues.