Discussion:
[PATCH] /run should be created if missing at startup
William Brown via samba-technical
2018-04-18 09:46:21 UTC
Permalink
Hi,

This patch fixes a minor issue in containers where you overlay /var
into the location. If /run is missing samba won't start. This patch
allows samba to attempt to recreate /run if it is missing at start up.

Thanks,

William
William Brown via samba-technical
2018-04-24 05:24:42 UTC
Permalink
On Wed, 2018-04-18 at 19:46 +1000, William Brown via samba-technical
Post by William Brown via samba-technical
Hi,
This patch fixes a minor issue in containers where you overlay /var
into the location. If /run is missing samba won't start. This patch
allows samba to attempt to recreate /run if it is missing at start up.
Thanks,
William
Ping, this patch still needs review I believe,

Thanks!

William
Alexander Bokovoy via samba-technical
2018-04-24 05:34:01 UTC
Permalink
Post by William Brown via samba-technical
Hi,
This patch fixes a minor issue in containers where you overlay /var
into the location. If /run is missing samba won't start. This patch
allows samba to attempt to recreate /run if it is missing at start up.
Thanks,
William
From 028ed1b0bbfc7173b788abefb7b43f935ebbcc4e Mon Sep 17 00:00:00 2001
Date: Wed, 18 Apr 2018 19:44:33 +1000
Subject: [PATCH] s4/smbd/server.c: create /run if missing
In some cases (containers mainly) /var/run may not be present. Instead of
erroring, we should create it at startup.
---
source4/smbd/server.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 431fbad3139..beac4fff0ca 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -498,6 +498,10 @@ static int binary_smbd_main(const char *binary_name,
mkdir(lpcfg_lock_directory(cmdline_lp_ctx), 0755);
}
+ if (!directory_exist(lpcfg_pid_directory(cmdline_lp_ctx))) {
+ mkdir(lpcfg_pid_directory(cmdline_lp_ctx), 0755);
+ }
+
pidfile_create(lpcfg_pid_directory(cmdline_lp_ctx), binary_name);
if (lpcfg_server_role(cmdline_lp_ctx) == ROLE_ACTIVE_DIRECTORY_DC) {
Looking at source3/smbd/server.c, we do create lpcfg_pid_directory()
there already, so this puts source4/smbd on par with source3/smbd.

RB+ from my side. One more team reviewer, please!
--
/ Alexander Bokovoy
Jeremy Allison via samba-technical
2018-04-25 00:02:12 UTC
Permalink
Post by Alexander Bokovoy via samba-technical
Post by William Brown via samba-technical
Hi,
This patch fixes a minor issue in containers where you overlay /var
into the location. If /run is missing samba won't start. This patch
allows samba to attempt to recreate /run if it is missing at start up.
Thanks,
William
From 028ed1b0bbfc7173b788abefb7b43f935ebbcc4e Mon Sep 17 00:00:00 2001
Date: Wed, 18 Apr 2018 19:44:33 +1000
Subject: [PATCH] s4/smbd/server.c: create /run if missing
In some cases (containers mainly) /var/run may not be present. Instead of
erroring, we should create it at startup.
---
source4/smbd/server.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 431fbad3139..beac4fff0ca 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -498,6 +498,10 @@ static int binary_smbd_main(const char *binary_name,
mkdir(lpcfg_lock_directory(cmdline_lp_ctx), 0755);
}
+ if (!directory_exist(lpcfg_pid_directory(cmdline_lp_ctx))) {
+ mkdir(lpcfg_pid_directory(cmdline_lp_ctx), 0755);
+ }
+
pidfile_create(lpcfg_pid_directory(cmdline_lp_ctx), binary_name);
if (lpcfg_server_role(cmdline_lp_ctx) == ROLE_ACTIVE_DIRECTORY_DC) {
Looking at source3/smbd/server.c, we do create lpcfg_pid_directory()
there already, so this puts source4/smbd on par with source3/smbd.
RB+ from my side. One more team reviewer, please!
LGTM. RB+.
William Brown via samba-technical
2018-04-29 22:44:00 UTC
Permalink
On Tue, 2018-04-24 at 17:02 -0700, Jeremy Allison via samba-technical
Post by Jeremy Allison via samba-technical
Post by Alexander Bokovoy via samba-technical
Post by William Brown via samba-technical
Hi,
This patch fixes a minor issue in containers where you overlay /var
into the location. If /run is missing samba won't start. This patch
allows samba to attempt to recreate /run if it is missing at start up.
Thanks,
William
From 028ed1b0bbfc7173b788abefb7b43f935ebbcc4e Mon Sep 17 00:00:00 2001
Date: Wed, 18 Apr 2018 19:44:33 +1000
Subject: [PATCH] s4/smbd/server.c: create /run if missing
In some cases (containers mainly) /var/run may not be present. Instead of
erroring, we should create it at startup.
---
source4/smbd/server.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 431fbad3139..beac4fff0ca 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -498,6 +498,10 @@ static int binary_smbd_main(const char *binary_name,
mkdir(lpcfg_lock_directory(cmdline_lp_ctx),
0755);
}
+ if
(!directory_exist(lpcfg_pid_directory(cmdline_lp_ctx))) {
+ mkdir(lpcfg_pid_directory(cmdline_lp_ctx),
0755);
+ }
+
pidfile_create(lpcfg_pid_directory(cmdline_lp_ctx),
binary_name);
if (lpcfg_server_role(cmdline_lp_ctx) ==
ROLE_ACTIVE_DIRECTORY_DC) {
Looking at source3/smbd/server.c, we do create
lpcfg_pid_directory()
there already, so this puts source4/smbd on par with source3/smbd.
RB+ from my side. One more team reviewer, please!
LGTM. RB+.
Thank you! Has this been pushed?

William
Alexander Bokovoy via samba-technical
2018-04-30 05:49:10 UTC
Permalink
Post by William Brown via samba-technical
Post by Jeremy Allison via samba-technical
Post by Alexander Bokovoy via samba-technical
Looking at source3/smbd/server.c, we do create
lpcfg_pid_directory()
there already, so this puts source4/smbd on par with source3/smbd.
RB+ from my side. One more team reviewer, please!
LGTM. RB+.
Thank you! Has this been pushed?
Sorry, felt between cracks. I'll push tonight.
--
/ Alexander Bokovoy
William Brown via samba-technical
2018-04-30 06:57:18 UTC
Permalink
Post by Alexander Bokovoy via samba-technical
Post by William Brown via samba-technical
Post by Jeremy Allison via samba-technical
Post by Alexander Bokovoy via samba-technical
Looking at source3/smbd/server.c, we do create
lpcfg_pid_directory()
there already, so this puts source4/smbd on par with
source3/smbd.
RB+ from my side. One more team reviewer, please!
LGTM. RB+.
Thank you! Has this been pushed?
Sorry, felt between cracks. I'll push tonight.
No problems mate! I really appreciate your help with this :)

Thanks,

William
Alexander Bokovoy via samba-technical
2018-04-30 08:22:22 UTC
Permalink
Post by William Brown via samba-technical
Post by Alexander Bokovoy via samba-technical
Post by William Brown via samba-technical
Post by Jeremy Allison via samba-technical
Post by Alexander Bokovoy via samba-technical
Looking at source3/smbd/server.c, we do create
lpcfg_pid_directory()
there already, so this puts source4/smbd on par with
source3/smbd.
RB+ from my side. One more team reviewer, please!
LGTM. RB+.
Thank you! Has this been pushed?
Sorry, felt between cracks. I'll push tonight.
No problems mate! I really appreciate your help with this :)
No, it did not fall anywhere. Jeremy pushed it on April 18th:
git show 0e1125da5897
--
/ Alexander Bokovoy
William Brown via samba-technical
2018-04-30 22:04:31 UTC
Permalink
Post by Alexander Bokovoy via samba-technical
Post by William Brown via samba-technical
Post by Alexander Bokovoy via samba-technical
Post by William Brown via samba-technical
Post by Jeremy Allison via samba-technical
Post by Alexander Bokovoy via samba-technical
Looking at source3/smbd/server.c, we do create
lpcfg_pid_directory()
there already, so this puts source4/smbd on par with
source3/smbd.
RB+ from my side. One more team reviewer, please!
LGTM. RB+.
Thank you! Has this been pushed?
Sorry, felt between cracks. I'll push tonight.
No problems mate! I really appreciate your help with this :)
git show 0e1125da5897
I must have missed it also. Thank you!

Loading...