Your message dated Sun, 8 Apr 2018 11:44:40 +0200
with message-id 
<cafx5sbznp-3arkmi_c8_caw8qbqb9k25fq9cen4bnjcjz+t...@mail.gmail.com>
and subject line setproctitle_init used in 4.8
has caused the Debian Bug report #741492,
regarding samba: all process have same title (setproctitle not working)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
741492: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741492
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: samba
Version: 2:4.1.5+dfsg-1
Severity: minor
Tags: upstream patch

Dear Maintainer,

Process titles remain the same as the parent even though libbsd and
and setproctitle support are correctly detected during package build.

Additionally log.samba contains a number of ominous messages:
samba: setproctitle not initialized, please either call setproctitle_init() or 
link against libbsd-ctor.

Attached patch completes the setproctitle support when using libbsd.
There may be a way to link libbsd-ctor.a and elminiate the extra defines,
but my wscript foo is lacking.

without attached patch:

24650 ?        Ss     0:00 /usr/sbin/samba -D
24661 ?        S      0:00  \_ /usr/sbin/samba -D
24663 ?        Ss     0:00  |   \_ /usr/sbin/smbd -D --option=server role 
check:inhibit=yes --foreground
24715 ?        S      0:00  |       \_ /usr/sbin/smbd -D --option=server role 
check:inhibit=yes --foreground
28724 ?        S      0:00  |       \_ /usr/sbin/smbd -D --option=server role 
check:inhibit=yes --foreground
24662 ?        S      0:00  \_ /usr/sbin/samba -D
24664 ?        S      0:00  \_ /usr/sbin/samba -D
24665 ?        S      0:00  \_ /usr/sbin/samba -D
24666 ?        S      0:00  \_ /usr/sbin/samba -D
24667 ?        S      0:00  \_ /usr/sbin/samba -D
24668 ?        S      0:00  \_ /usr/sbin/samba -D
24669 ?        S      0:00  \_ /usr/sbin/samba -D
24670 ?        S      0:00  \_ /usr/sbin/samba -D
24671 ?        S      0:00  \_ /usr/sbin/samba -D
24672 ?        S      0:00  \_ /usr/sbin/samba -D
24673 ?        S      0:00  \_ /usr/sbin/samba -D
24676 ?        S      0:00  \_ /usr/sbin/samba -D

with attached patch:

 9660 ?        Ss     0:00 /usr/sbin/samba -D
 9697 ?        S      0:00  \_ samba: task[s3fs_parent]
 9699 ?        Ss     0:00  |   \_ /usr/sbin/smbd -D --option=server role 
check:inhibit=yes --foreground
10126 ?        S      0:00  |       \_ /usr/sbin/smbd -D --option=server role 
check:inhibit=yes --foreground
 9698 ?        S      0:00  \_ samba: task[dcesrv]
 9700 ?        S      0:00  \_ samba: task[nbtd]
 9701 ?        S      0:00  \_ samba: task wrepl server_id[9701]
 9702 ?        S      0:00  \_ samba: task[ldapsrv]
 9703 ?        S      0:00  \_ samba: task[cldapd]
 9704 ?        S      0:00  \_ samba: task[kdc]
 9706 ?        S      0:00  \_ samba: task[dreplsrv]
 9709 ?        S      0:00  \_ samba: task[winbind]
 9710 ?        S      0:00  \_ samba: task[ntp_signd]
 9714 ?        S      0:00  \_ samba: task[kccsrv]
 9715 ?        S      0:00  \_ samba: task[dnsupdate]
 9716 ?        S      0:00  \_ samba: task[dns]
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -265,6 +265,8 @@
         conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
     if not conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h'):
         conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h')
+    else:
+        conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
 
     conf.CHECK_CODE('''
                 struct ucred cred;
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -900,3 +900,8 @@
 {
 }
 #endif
+#ifndef HAVE_SETPROCTITLE_INIT
+void rep_setproctitle_init(int argc, const char *argv[], char *envp[])
+{
+}
+#endif
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -898,5 +898,9 @@
 #define setproctitle rep_setproctitle
 void rep_setproctitle(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
 #endif
+#ifndef HAVE_SETPROCTITLE_INIT
+#define setproctitle_init rep_setproctitle_init
+void rep_setproctitle_init(int argc, const char *argv[], char *envp[]);
+#endif
 
 #endif /* _LIBREPLACE_REPLACE_H */
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -509,7 +509,8 @@
 	return 0;
 }
 
-int main(int argc, const char *argv[])
+int main(int argc, const char *argv[], const char *envp[])
 {
+	setproctitle_init(argc, argv, envp);
 	return binary_smbd_main("samba", argc, argv);
 }

--- End Message ---
--- Begin Message ---
Version: 2:4.8.0+dfsg-1

Probably fixed by 4f84b6dfa87964d8b99a45021fa51835c962876c in 4.8.0

Regards
-- 
Mathieu Parent

--- End Message ---

Reply via email to