[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Mon Jul 2 11:20:01 MDT 2012


The branch, master has been updated
       via  993e809 s3-libpidfile: fix check for running process.
       via  a440df9 s3-libpidfile: some more debug output
      from  2105400 s4-torture: more printf removal from samlogon torture test.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 993e809b5afde135edb191e964edf83e578e6827
Author: Björn Baumbach <bb at sernet.de>
Date:   Mon Jul 2 15:43:49 2012 +0200

    s3-libpidfile: fix check for running process.
    
    Call pidfile_pid() with process name instead of pid file name.
    pidfile_pid does create the pid file name by itself.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Mon Jul  2 19:19:21 CEST 2012 on sn-devel-104

commit a440df93a647d396ea19d64cba1bb5b0dee42cd0
Author: Björn Baumbach <bb at sernet.de>
Date:   Mon Jul 2 15:30:49 2012 +0200

    s3-libpidfile: some more debug output
    
    Signed-off-by: Michael Adam <obnox at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/pidfile.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c
index ec2044f..f0c075c 100644
--- a/source3/lib/pidfile.c
+++ b/source3/lib/pidfile.c
@@ -89,20 +89,26 @@ pid_t pidfile_pid(const char *program_name)
 	
 	pid = (pid_t)ret;
 	if (!process_exists_by_pid(pid)) {
+		DEBUG(10, ("Process with PID=%d does not exist.\n", (int)pid));
 		goto noproc;
 	}
 
 	if (fcntl_lock(fd,F_SETLK,0,1,F_RDLCK)) {
 		/* we could get the lock - it can't be a Samba process */
+		DEBUG(10, ("Process with PID=%d is no Samba process.\n",
+			  (int)pid));
 		goto noproc;
 	}
 
+	DEBUG(10, ("Process with PID=%d is running.\n", (int)pid));
 	SAFE_FREE(pidFile);
 	close(fd);
 	return (pid_t)ret;
 
  noproc:
 	close(fd);
+	DEBUG(10, ("Deleting %s, since %d is no Samba process.\n", pidFile,
+		  (int)pid));
 	unlink(pidFile);
 	SAFE_FREE(pidFile);
 	return 0;
@@ -140,7 +146,7 @@ void pidfile_create(const char *program_name)
 		smb_panic("asprintf failed");
 	}
 
-	pid = pidfile_pid(name);
+	pid = pidfile_pid(program_name);
 	if (pid != 0) {
 		DEBUG(0,("ERROR: %s is already running. File %s exists and process id %d is running.\n", 
 			 name, pidFile_name, (int)pid));


-- 
Samba Shared Repository


More information about the samba-cvs mailing list