Signed-off-by: Juergen Borleis <j...@pengutronix.de>
---
 ...ate-expected-directories-at-run-time.patch | 38 +++++++++++++++++++
 patches/samba-4.9.5/series                    |  4 ++
 rules/samba.in                                |  9 ++++-
 3 files changed, 49 insertions(+), 2 deletions(-)
 create mode 100644 
patches/samba-4.9.5/0001-Lets-systemd-create-expected-directories-at-run-time.patch
 create mode 100644 patches/samba-4.9.5/series

diff --git 
a/patches/samba-4.9.5/0001-Lets-systemd-create-expected-directories-at-run-time.patch
 
b/patches/samba-4.9.5/0001-Lets-systemd-create-expected-directories-at-run-time.patch
new file mode 100644
index 000000000..8569e0737
--- /dev/null
+++ 
b/patches/samba-4.9.5/0001-Lets-systemd-create-expected-directories-at-run-time.patch
@@ -0,0 +1,38 @@
+From: Juergen Borleis <juer...@kreuzholzen.de>
+Date: Tue, 4 Jun 2019 20:24:15 +0200
+Subject: [PATCH] Lets systemd create expected directories at run-time
+
+'samba' requires '/var/lib/samba' and '/var/cache/samba'.
+
+Signed-off-by: Juergen Borleis <juer...@kreuzholzen.de>
+---
+ packaging/systemd/nmb.service.in | 2 ++
+ packaging/systemd/smb.service.in | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/packaging/systemd/nmb.service.in 
b/packaging/systemd/nmb.service.in
+index a30812320c05..c9373d2ba0a6 100644
+--- a/packaging/systemd/nmb.service.in
++++ b/packaging/systemd/nmb.service.in
+@@ -8,6 +8,8 @@ After=network.target network-online.target
+ Type=notify
+ NotifyAccess=all
+ PIDFile=@PIDDIR@/nmbd.pid
++StateDirectory=samba
++CacheDirectory=samba
+ EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ ExecStart=@SBINDIR@/nmbd --foreground --no-process-group $NMBDOPTIONS
+ ExecReload=/bin/kill -HUP $MAINPID
+diff --git a/packaging/systemd/smb.service.in 
b/packaging/systemd/smb.service.in
+index 18912ef0e98f..76aedfa20337 100644
+--- a/packaging/systemd/smb.service.in
++++ b/packaging/systemd/smb.service.in
+@@ -9,6 +9,8 @@ Type=notify
+ NotifyAccess=all
+ PIDFile=@PIDDIR@/smbd.pid
+ LimitNOFILE=16384
++StateDirectory=samba
++CacheDirectory=samba
+ EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ ExecStart=@SBINDIR@/smbd --foreground --no-process-group $SMBDOPTIONS
+ ExecReload=/bin/kill -HUP $MAINPID
diff --git a/patches/samba-4.9.5/series b/patches/samba-4.9.5/series
new file mode 100644
index 000000000..b2dcdc0a4
--- /dev/null
+++ b/patches/samba-4.9.5/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Lets-systemd-create-expected-directories-at-run-time.patch
+# 2d2f83b2911fe3f43bff610738827040  - git-ptx-patches magic
diff --git a/rules/samba.in b/rules/samba.in
index ec5423661..822a9758a 100644
--- a/rules/samba.in
+++ b/rules/samba.in
@@ -17,8 +17,10 @@ menuconfig SAMBA
        select LIBCAP
        select LIBPOPT
        select READLINE
-       select SYSTEMD                          if SAMBA_SYSTEMD_UNIT
+       select SYSTEMD                          if SAMBA_SYSTEMD_UNIT && RUNTIME
        select ZLIB
+       select ROOTFS_VAR_LIB                   if RUNTIME
+       select ROOTFS_VAR_CACHE                 if RUNTIME
        help
          Samba is an Open Source/Free Software suite that has, since
          1992, provided file and print services to all manner of
@@ -28,6 +30,9 @@ menuconfig SAMBA
 
          See http://www.samba.org for details.
 
+         Note: on a read-only root filesystem this package still requires a
+         writable '/var/lib' and '/var/cache'.
+
 if SAMBA
 
 config SAMBA_COMMON
@@ -64,7 +69,7 @@ config SAMBA_CUPS
 config SAMBA_STARTSCRIPT
        bool
        default y
-       depends on SAMBA_SERVER
+       depends on SAMBA_SERVER && !INITMETHOD_SYSTEMD
        prompt "install /etc/init.d/samba"
 
 config SAMBA_SYSTEMD_UNIT
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to