Post by William Brown via samba-technicalHi,
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) {
there already, so this puts source4/smbd on par with source3/smbd.
RB+ from my side. One more team reviewer, please!