The Samba-Bugzilla – Attachment 7249 Details for
Bug 8714
smbcontrol can't find the pid file of winbindd because the later is created with a different name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed solution to fix the problem
0001-s3-pid-Catch-with-pid-filename-s-change-when-config-.patch (text/plain), 1.56 KB, created by
Matthieu Patou
on 2012-01-23 08:00:00 UTC
(
hide
)
Description:
Proposed solution to fix the problem
Filename:
MIME Type:
Creator:
Matthieu Patou
Created:
2012-01-23 08:00:00 UTC
Size:
1.56 KB
patch
obsolete
>From 3a42f526e145739b19e912b4d54c96cf5688334b Mon Sep 17 00:00:00 2001 >From: Matthieu Patou <mat@matws.net> >Date: Fri, 20 Jan 2012 14:02:45 -0800 >Subject: [PATCH] s3-pid: Catch with pid filename's change when config file is > not smb.conf > >This is what is done in pidfile_create >--- > source3/lib/pidfile.c | 23 ++++++++++++++++++++++- > 1 files changed, 22 insertions(+), 1 deletions(-) > >diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c >index 88d0fb0..1828e49 100644 >--- a/source3/lib/pidfile.c >+++ b/source3/lib/pidfile.c >@@ -30,14 +30,35 @@ static char *pidFile_name = NULL; > > /* return the pid in a pidfile. return 0 if the process (or pidfile) > does not exist */ >-pid_t pidfile_pid(const char *name) >+pid_t pidfile_pid(const char *program_name) > { > int fd; > char pidstr[20]; > pid_t pid; > unsigned int ret; >+ char *name; >+ const char *short_configfile; > char * pidFile; > >+ /* Add a suffix to the program name if this is a process with a >+ * none default configuration file name. */ >+ if (strcmp( CONFIGFILE, get_dyn_CONFIGFILE()) == 0) { >+ name = SMB_STRDUP(program_name); >+ } else { >+ short_configfile = strrchr( get_dyn_CONFIGFILE(), '/'); >+ if (short_configfile == NULL) { >+ /* conf file in current directory */ >+ short_configfile = get_dyn_CONFIGFILE(); >+ } else { >+ /* full/relative path provided */ >+ short_configfile++; >+ } >+ if (asprintf(&name, "%s-%s", program_name, >+ short_configfile) == -1) { >+ smb_panic("asprintf failed"); >+ } >+ } >+ > if (asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name) == -1) { > return 0; > } >-- >1.7.5.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 8714
:
7249
|
7253
|
7339