Skip to contentSkip to conversation

stale pid files?

Qemu-devel Axel Kittenberger 2 participants 2 messages Jun 1, 2007

lore
Share & tools
lore
#0 lore raw

Hi list again, another suggestion.

I use the deamons pidfile feature to write pidfiles so I can controll the virtual machines with /etc/init.d/bla scripts, to e.g. auto spawn the guests when the server starts, auto/start/stop with runlevels and so on.. However I got following issue, the daemon wont start if there is a pidfile already (yes no problem for user to delete, but for auto spawning after unattended boot) . Since e.g. following situation: BANG! Powerout! .... System goes up when power is available again. The init scripts want to start the qemu/kvm deamons, but they refuse because these see their pidfiles already from pre-powerout..

I have seen other daemons somehow locking their pidfiles while running, and when killed -9ed, or poweroutes and they start again, they see their pid-file is unlocked, thus stale, and just overwrite it... only notifing you with a message they did so.

Kind Regards,
Axel

#1 lore raw
Quoted 3 lines · Axel Kittenberger

Hi list again, another suggestion.

I use the deamons pidfile feature to write pidfiles so I can controll the virtual machines with /etc/init.d/bla scripts, to e.g. auto spawn the guests when the server starts, auto/start/stop with runlevels and so on.. However I got following issue, the daemon wont start if there is a pidfile already (yes no problem for user to delete, but for auto spawning after unattended boot) . Since e.g. following situation: BANG! Powerout! .... System goes up when power is available again. The init scripts want to start the qemu/kvm deamons, but they refuse because these see their pidfiles already from pre-powerout..

-pidfile behaves properly in CVS. You may be able to find the patch on the ML that fixed it.

Regards,

Anthony Liguori

Quoted 7 lines

I have seen other daemons somehow locking their pidfiles while running, and when killed -9ed, or poweroutes and they start again, they see their pid-file is unlocked, thus stale, and just overwrite it... only notifing you with a message they did so.

Kind Regards,
Axel