167d4b
From f73c906237aa0c9d45900d69d31c9b39261f062a Mon Sep 17 00:00:00 2001
167d4b
From: Andreas Schneider <asn@samba.org>
167d4b
Date: Tue, 16 Sep 2014 18:02:30 +0200
167d4b
Subject: [PATCH 1/2] lib: Add daemon_status() to util library.
167d4b
167d4b
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10816
167d4b
167d4b
Signed-off-by: Andreas Schneider <asn@samba.org>
167d4b
Reviewed-by: Alexander Bokovoy <ab@samba.org>
167d4b
(cherry picked from commit 9f5f5fa8ebf845c53b7a92557d7aec56ed820320)
167d4b
---
167d4b
 lib/util/become_daemon.c | 11 +++++++++++
167d4b
 lib/util/samba_util.h    |  6 ++++++
167d4b
 2 files changed, 17 insertions(+)
167d4b
167d4b
diff --git a/lib/util/become_daemon.c b/lib/util/become_daemon.c
167d4b
index 35c8b32..688bedd 100644
167d4b
--- a/lib/util/become_daemon.c
167d4b
+++ b/lib/util/become_daemon.c
167d4b
@@ -135,3 +135,14 @@ _PUBLIC_ void daemon_ready(const char *daemon)
167d4b
 #endif
167d4b
 	DEBUG(0, ("STATUS=daemon '%s' finished starting up and ready to serve connections", daemon));
167d4b
 }
167d4b
+
167d4b
+_PUBLIC_ void daemon_status(const char *name, const char *msg)
167d4b
+{
167d4b
+	if (name == NULL) {
167d4b
+		name = "Samba";
167d4b
+	}
167d4b
+#ifdef HAVE_SYSTEMD
167d4b
+	sd_notifyf(0, "\nSTATUS=%s: %s", name, msg);
167d4b
+#endif
167d4b
+	DEBUG(0, ("STATUS=daemon '%s' : %s", name, msg));
167d4b
+}
167d4b
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
167d4b
index e3fe6a6..f4216d8 100644
167d4b
--- a/lib/util/samba_util.h
167d4b
+++ b/lib/util/samba_util.h
167d4b
@@ -853,6 +853,12 @@ _PUBLIC_ void exit_daemon(const char *msg, int error);
167d4b
 **/
167d4b
 _PUBLIC_ void daemon_ready(const char *daemon);
167d4b
 
167d4b
+/*
167d4b
+ * Report the daemon status. For example if it is not ready to serve connections
167d4b
+ * and is waiting for some event to happen.
167d4b
+ */
167d4b
+_PUBLIC_ void daemon_status(const char *name, const char *msg);
167d4b
+
167d4b
 /**
167d4b
  * @brief Get a password from the console.
167d4b
  *
167d4b
-- 
167d4b
2.1.0
167d4b
167d4b
167d4b
From 7fcd74039961fa0fb02934bc87ce41fd98234f1a Mon Sep 17 00:00:00 2001
167d4b
From: Andreas Schneider <asn@samba.org>
167d4b
Date: Tue, 16 Sep 2014 18:03:51 +0200
167d4b
Subject: [PATCH 2/2] nmbd: Send waiting status to systemd.
167d4b
167d4b
This tells the Administrator what's going on and we should log that IPv6
167d4b
is not supported.
167d4b
167d4b
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10816
167d4b
167d4b
Signed-off-by: Andreas Schneider <asn@samba.org>
167d4b
Reviewed-by: Alexander Bokovoy <ab@samba.org>
167d4b
167d4b
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
167d4b
Autobuild-Date(master): Wed Sep 17 13:16:43 CEST 2014 on sn-devel-104
167d4b
167d4b
(cherry picked from commit 2df601bff0d949e66c79366b8248b9d950c0b430)
167d4b
---
167d4b
 source3/nmbd/nmbd_subnetdb.c | 7 +++++--
167d4b
 1 file changed, 5 insertions(+), 2 deletions(-)
167d4b
167d4b
diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c
167d4b
index 311a240..6c483af 100644
167d4b
--- a/source3/nmbd/nmbd_subnetdb.c
167d4b
+++ b/source3/nmbd/nmbd_subnetdb.c
167d4b
@@ -247,8 +247,11 @@ bool create_subnets(void)
167d4b
 
167d4b
 	/* Only count IPv4, non-loopback interfaces. */
167d4b
 	if (iface_count_v4_nl() == 0) {
167d4b
-		DEBUG(0,("create_subnets: No local IPv4 non-loopback interfaces !\n"));
167d4b
-		DEBUG(0,("create_subnets: Waiting for an interface to appear ...\n"));
167d4b
+		daemon_status("nmbd",
167d4b
+			      "No local IPv4 non-loopback interfaces "
167d4b
+			      "available, waiting for interface ...");
167d4b
+		DEBUG(0,("NOTE: NetBIOS name resolution is not supported for "
167d4b
+			 "Internet Protocol Version 6 (IPv6).\n"));
167d4b
 	}
167d4b
 
167d4b
 	/* We only count IPv4, non-loopback interfaces here. */
167d4b
-- 
167d4b
2.1.0
167d4b