]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Lock the vmtoolsd pid file when daemonizing.
authorVMware, Inc <>
Wed, 20 Jul 2011 20:37:44 +0000 (13:37 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Wed, 20 Jul 2011 20:37:44 +0000 (13:37 -0700)
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 <mvanzin@vmware.com>
open-vm-tools/services/vmtoolsd/mainPosix.c

index 686ea112686d962f6ed88405c4d1306d2a0f1674..c4c04ccbf9cf43724522c3b03ef979792d82ca3d 100644 (file)
@@ -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;
       }