Summary: | sys-apps/preload-0.6.4-r1: race condition in init script | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Ambroz Bizjak <ambrop7> |
Component: | New packages | Assignee: | Pacho Ramos <pacho> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | genzilla, mgorny |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 310511 | ||
Attachments: |
patch for preload init script
patch for preload init script init script |
Description
Ambroz Bizjak
2009-12-31 17:34:04 UTC
Created attachment 214782 [details, diff]
patch for preload init script
This patch solves the problem by starting preload with ionice.
Created attachment 214785 [details, diff]
patch for preload init script
expand options to arguments...
Thanks for the patch, looks like a good solution. Assigning to maintainer. I no longer use this application and have dropped maintainer-ship. With your patch, preload no longer starts :-(, I simply get: * Starting preload ... [ !! ] The problem is that I don't know where it is failing, I simply checked that, if I force it to run without ionice (I mean, I make it EXEC="/usr/sbin/preload" and ARGS=() ) it succeeds I cannot reproduce this. You may be giving invalid options to ionice. Try running the resulting command by hand. I have added the following to init.d to test: echo ${PIDFILE} echo "$EXEC" echo "${ARGS[@]}" echo ${PRELOAD_LOGFILE:-/var/log/preload.log} echo ${PRELOAD_VERBOSITY:-1} echo ${PRELOAD_NICE:-15} echo ${PRELOAD_STATEFILE:-""} echo ${PRELOAD_OPTS} Resulting in: * Starting preload ... /var/run/preload.pid /usr/bin/ionice -c3 /usr/sbin/preload /var/log/preload.log 1 15 /var/lib/preload/preload.state [ !! ] But it seems to run when manually running: # start-stop-daemon --start --quiet --background --make-pidfile --pidfile /var/run/preload.pid --exec /usr/bin/ionice -- -c3 /usr/sbin/preload -l /var/log/preload.log -V 1 -n 15 -s /var/lib/preload/preload.state -f # echo $? 0 :-/ Created attachment 229317 [details]
init script
Looks like something is having problems with arrays. Try this one.
Sadly still the same :-( Are you using baselayout-2/openrc ? I am still using baselayout-1 (that runs scripts using bash instead of dash) The more correct approach is to start s-s-d through ionice (the priority descends to the child process). I've attached a fixed init.d script to bug #310511. +*preload-0.6.4-r2 (07 Sep 2010) + + 07 Sep 2010; Pacho Ramos <pacho@gentoo.org> +preload-0.6.4-r2.ebuild, + +files/preload-0.6.4.init.in-r1: + Revision bump to fix race condition (bug #299140 by Ambroz Bizjak) and + make it POSIX compliant (bug #310511 by Michał Górny), thanks a lot to + Michał for providing the new init.d script. |