From: VMware, Inc <> Date: Wed, 20 Jul 2011 20:37:44 +0000 (-0700) Subject: Lock the vmtoolsd pid file when daemonizing. X-Git-Tag: 2011.07.19-450511~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca413e61f00d4f71f64075e62eef6d75e41111bc;p=thirdparty%2Fopen-vm-tools.git Lock the vmtoolsd pid file when daemonizing. Use the newly introduced HOSTINFO_DAEMONIZE_LOCKPID flag to lock the pid file vmtoolsd generates when daemonizing so that vmtoolsd will refuse to run multiple instances using the same pid file. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/services/vmtoolsd/mainPosix.c b/open-vm-tools/services/vmtoolsd/mainPosix.c index 686ea1126..c4c04ccbf 100644 --- a/open-vm-tools/services/vmtoolsd/mainPosix.c +++ b/open-vm-tools/services/vmtoolsd/mainPosix.c @@ -187,7 +187,7 @@ main(int argc, if (!Hostinfo_Daemonize(argv[0], argv, - HOSTINFO_DAEMONIZE_DEFAULT, + HOSTINFO_DAEMONIZE_LOCKPID, gState.pidFile, NULL, 0)) { goto exit; }