diff options
Diffstat (limited to 'meta-oe/recipes-connectivity/samba/samba-4.1.12/06-fix-nmbd-systemd-status-update.patch')
-rw-r--r-- | meta-oe/recipes-connectivity/samba/samba-4.1.12/06-fix-nmbd-systemd-status-update.patch | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/samba/samba-4.1.12/06-fix-nmbd-systemd-status-update.patch b/meta-oe/recipes-connectivity/samba/samba-4.1.12/06-fix-nmbd-systemd-status-update.patch new file mode 100644 index 000000000..7a7bdf53c --- /dev/null +++ b/meta-oe/recipes-connectivity/samba/samba-4.1.12/06-fix-nmbd-systemd-status-update.patch | |||
@@ -0,0 +1,97 @@ | |||
1 | From f73c906237aa0c9d45900d69d31c9b39261f062a Mon Sep 17 00:00:00 2001 | ||
2 | From: Andreas Schneider <asn@samba.org> | ||
3 | Date: Tue, 16 Sep 2014 18:02:30 +0200 | ||
4 | Subject: [PATCH 1/2] lib: Add daemon_status() to util library. | ||
5 | |||
6 | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10816 | ||
7 | |||
8 | Signed-off-by: Andreas Schneider <asn@samba.org> | ||
9 | Reviewed-by: Alexander Bokovoy <ab@samba.org> | ||
10 | (cherry picked from commit 9f5f5fa8ebf845c53b7a92557d7aec56ed820320) | ||
11 | --- | ||
12 | lib/util/become_daemon.c | 11 +++++++++++ | ||
13 | lib/util/samba_util.h | 6 ++++++ | ||
14 | 2 files changed, 17 insertions(+) | ||
15 | |||
16 | diff --git a/lib/util/become_daemon.c b/lib/util/become_daemon.c | ||
17 | index 35c8b32..688bedd 100644 | ||
18 | --- a/lib/util/become_daemon.c | ||
19 | +++ b/lib/util/become_daemon.c | ||
20 | @@ -135,3 +135,14 @@ _PUBLIC_ void daemon_ready(const char *daemon) | ||
21 | #endif | ||
22 | DEBUG(0, ("STATUS=daemon '%s' finished starting up and ready to serve connections", daemon)); | ||
23 | } | ||
24 | + | ||
25 | +_PUBLIC_ void daemon_status(const char *name, const char *msg) | ||
26 | +{ | ||
27 | + if (name == NULL) { | ||
28 | + name = "Samba"; | ||
29 | + } | ||
30 | +#ifdef HAVE_SYSTEMD | ||
31 | + sd_notifyf(0, "\nSTATUS=%s: %s", name, msg); | ||
32 | +#endif | ||
33 | + DEBUG(0, ("STATUS=daemon '%s' : %s", name, msg)); | ||
34 | +} | ||
35 | diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h | ||
36 | index e3fe6a6..f4216d8 100644 | ||
37 | --- a/lib/util/samba_util.h | ||
38 | +++ b/lib/util/samba_util.h | ||
39 | @@ -853,6 +853,12 @@ _PUBLIC_ void exit_daemon(const char *msg, int error); | ||
40 | **/ | ||
41 | _PUBLIC_ void daemon_ready(const char *daemon); | ||
42 | |||
43 | +/* | ||
44 | + * Report the daemon status. For example if it is not ready to serve connections | ||
45 | + * and is waiting for some event to happen. | ||
46 | + */ | ||
47 | +_PUBLIC_ void daemon_status(const char *name, const char *msg); | ||
48 | + | ||
49 | /** | ||
50 | * @brief Get a password from the console. | ||
51 | * | ||
52 | -- | ||
53 | 2.1.0 | ||
54 | |||
55 | |||
56 | From 7fcd74039961fa0fb02934bc87ce41fd98234f1a Mon Sep 17 00:00:00 2001 | ||
57 | From: Andreas Schneider <asn@samba.org> | ||
58 | Date: Tue, 16 Sep 2014 18:03:51 +0200 | ||
59 | Subject: [PATCH 2/2] nmbd: Send waiting status to systemd. | ||
60 | |||
61 | This tells the Administrator what's going on and we should log that IPv6 | ||
62 | is not supported. | ||
63 | |||
64 | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10816 | ||
65 | |||
66 | Signed-off-by: Andreas Schneider <asn@samba.org> | ||
67 | Reviewed-by: Alexander Bokovoy <ab@samba.org> | ||
68 | |||
69 | Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> | ||
70 | Autobuild-Date(master): Wed Sep 17 13:16:43 CEST 2014 on sn-devel-104 | ||
71 | |||
72 | (cherry picked from commit 2df601bff0d949e66c79366b8248b9d950c0b430) | ||
73 | --- | ||
74 | source3/nmbd/nmbd_subnetdb.c | 7 +++++-- | ||
75 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
76 | |||
77 | diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c | ||
78 | index 311a240..6c483af 100644 | ||
79 | --- a/source3/nmbd/nmbd_subnetdb.c | ||
80 | +++ b/source3/nmbd/nmbd_subnetdb.c | ||
81 | @@ -247,8 +247,11 @@ bool create_subnets(void) | ||
82 | |||
83 | /* Only count IPv4, non-loopback interfaces. */ | ||
84 | if (iface_count_v4_nl() == 0) { | ||
85 | - DEBUG(0,("create_subnets: No local IPv4 non-loopback interfaces !\n")); | ||
86 | - DEBUG(0,("create_subnets: Waiting for an interface to appear ...\n")); | ||
87 | + daemon_status("nmbd", | ||
88 | + "No local IPv4 non-loopback interfaces " | ||
89 | + "available, waiting for interface ..."); | ||
90 | + DEBUG(0,("NOTE: NetBIOS name resolution is not supported for " | ||
91 | + "Internet Protocol Version 6 (IPv6).\n")); | ||
92 | } | ||
93 | |||
94 | /* We only count IPv4, non-loopback interfaces here. */ | ||
95 | -- | ||
96 | 2.1.0 | ||
97 | |||