RPM init.d script sometimes lies

Bug #702579 reported by Andrew Hutchings
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Invalid
Medium
Andrew Hutchings
7.0
Invalid
Medium
Andrew Hutchings
pkg-drizzle
Confirmed
Undecided
BJ Dierkes

Bug Description

Rackspace found that the RPM init.d script would sometimes show that the server started when it didn't. We need to look into this.

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

ok, so. The init.d script is starting drizzled as a background task with '&' at the end and trying to capture the result (which will fail because you can't capture the result of a background task like that).

What we need to do is make sure the PID file is created correctly like the support-files/mysql.server script which comes with the MySQL source.

Changed in pkg-drizzle:
assignee: nobody → BJ Dierkes (derks)
status: New → Confirmed
Revision history for this message
BJ Dierkes (derks) wrote :

Unfortunately looking for a pid file immediately after startup of drizzled is not sufficient. The pid_file is created early in startup... it might be a few seconds before drizzled detects a failure... therefore leading the init script to think things started properly... but again being misleading.

What seems to be required is a '--daemonize' option to drizzled... so that we can no longer rely on '&', and properly get the return of drizzled on startup.

See: https://launchpad.net/bugs/565053

Revision history for this message
Monty Taylor (mordred) wrote : Re: [Bug 702579] Re: RPM init.d script sometimes lies

On 01/17/2011 01:37 PM, BJ Dierkes wrote:
> Unfortunately looking for a pid file immediately after startup of
> drizzled is not sufficient. The pid_file is created early in startup...
> it might be a few seconds before drizzled detects a failure... therefore
> leading the init script to think things started properly... but again
> being misleading.
>
> What seems to be required is a '--daemonize' option to drizzled... so
> that we can no longer rely on '&', and properly get the return of
> drizzled on startup.
>
> See: https://launchpad.net/bugs/565053
>

What if we just waited to create the PID file?

Revision history for this message
BJ Dierkes (derks) wrote :

It might work initially... however it is a bit of a hack. Because using '&' spawns the process there is no telling that it started properly or not... just that it was spawned. What if the process dies immediately after the pid_file is created? Also, looking for a pid_file means we might need to sleep after starting drizzled... otherwise the pid_file might not have been created yet. How long do you sleep? 1 second might be good... but what if the box is heavily loaded... that might be 3 seconds. So what if we wait 3 seconds... and for some reason drizzled takes 5 seconds to write the pid on startup... now we're back to where we started.

Its just overall unreliable really. Having drizzled control how it is daemonized I think is the best solution, primarily because the sequence of the init start process doesn't continue until drizzled releases itself to the background (meaning its ready to role) and the init script doesn't try to say things are ok before it even knows things are ok.

Revision history for this message
Stewart Smith (stewart) wrote :

Please look at https://bugs.launchpad.net/drizzle/+bug/565053 and how we plan to deal with this. It'll probably just be a simple init script fix by the time that bugfix is done.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.