On Mon, Dec 09, 2013 at 05:23:29PM +1100, Michael Chapman wrote:
virtlockd's argv[0] may not contain a full path to the binary,
however
it should contain something that can be looked up in the PATH. Use
execvp() to do path lookup when re-executing ourselves.
After re-execution, we must not attempt to daemonize again. It's not
only unnecessary, but it also means we end up with the wrong PID and so
we can't validate the state file.
Instead, build a new argv for the new program that does not include
--daemon.
It would seem to be simpler to instead change the main() method
so that --daemon is ignored when re-exec'ing.
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|