aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-connectivity/samba/samba-4.1.12/06-fix-nmbd-systemd-status-update.patch
blob: 7a7bdf53ca8d086a918ee8f8361ad239ad12acd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
From f73c906237aa0c9d45900d69d31c9b39261f062a Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Tue, 16 Sep 2014 18:02:30 +0200
Subject: [PATCH 1/2] lib: Add daemon_status() to util library.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10816

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
(cherry picked from commit 9f5f5fa8ebf845c53b7a92557d7aec56ed820320)
---
 lib/util/become_daemon.c | 11 +++++++++++
 lib/util/samba_util.h    |  6 ++++++
 2 files changed, 17 insertions(+)

diff --git a/lib/util/become_daemon.c b/lib/util/become_daemon.c
index 35c8b32..688bedd 100644
--- a/lib/util/become_daemon.c
+++ b/lib/util/become_daemon.c
@@ -135,3 +135,14 @@ _PUBLIC_ void daemon_ready(const char *daemon)
 #endif
 	DEBUG(0, ("STATUS=daemon '%s' finished starting up and ready to serve connections", daemon));
 }
+
+_PUBLIC_ void daemon_status(const char *name, const char *msg)
+{
+	if (name == NULL) {
+		name = "Samba";
+	}
+#ifdef HAVE_SYSTEMD
+	sd_notifyf(0, "\nSTATUS=%s: %s", name, msg);
+#endif
+	DEBUG(0, ("STATUS=daemon '%s' : %s", name, msg));
+}
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index e3fe6a6..f4216d8 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -853,6 +853,12 @@ _PUBLIC_ void exit_daemon(const char *msg, int error);
 **/
 _PUBLIC_ void daemon_ready(const char *daemon);
 
+/*
+ * Report the daemon status. For example if it is not ready to serve connections
+ * and is waiting for some event to happen.
+ */
+_PUBLIC_ void daemon_status(const char *name, const char *msg);
+
 /**
  * @brief Get a password from the console.
  *
-- 
2.1.0


From 7fcd74039961fa0fb02934bc87ce41fd98234f1a Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Tue, 16 Sep 2014 18:03:51 +0200
Subject: [PATCH 2/2] nmbd: Send waiting status to systemd.

This tells the Administrator what's going on and we should log that IPv6
is not supported.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10816

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Sep 17 13:16:43 CEST 2014 on sn-devel-104

(cherry picked from commit 2df601bff0d949e66c79366b8248b9d950c0b430)
---
 source3/nmbd/nmbd_subnetdb.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c
index 311a240..6c483af 100644
--- a/source3/nmbd/nmbd_subnetdb.c
+++ b/source3/nmbd/nmbd_subnetdb.c
@@ -247,8 +247,11 @@ bool create_subnets(void)
 
 	/* Only count IPv4, non-loopback interfaces. */
 	if (iface_count_v4_nl() == 0) {
-		DEBUG(0,("create_subnets: No local IPv4 non-loopback interfaces !\n"));
-		DEBUG(0,("create_subnets: Waiting for an interface to appear ...\n"));
+		daemon_status("nmbd",
+			      "No local IPv4 non-loopback interfaces "
+			      "available, waiting for interface ...");
+		DEBUG(0,("NOTE: NetBIOS name resolution is not supported for "
+			 "Internet Protocol Version 6 (IPv6).\n"));
 	}
 
 	/* We only count IPv4, non-loopback interfaces here. */
-- 
2.1.0