All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][PATCH][jethro] samba: fix smbd and nmbd paths in sysv initscript
@ 2016-04-28 12:30 Richard Leitner
  2016-04-28 12:52 ` Joshua G Lock
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Leitner @ 2016-04-28 12:30 UTC (permalink / raw)
  To: openembedded-devel

For the jethro branch.

The sysv initscript provided by samba assumes smbd and nmbd are
installed in /opt/samba/bin/. In our case both binaries are installed to
/usr/sbin/ by default. Therefore fix these paths.

Furthermore fix the name of the initscript in its usage text.

Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
---
 .../samba-4.1.12/22-fix-sysv-init-script.patch     | 23 ++++++++++++++++++++++
 .../recipes-connectivity/samba/samba_4.1.12.bb     |  1 +
 2 files changed, 24 insertions(+)
 create mode 100644 meta-networking/recipes-connectivity/samba/samba-4.1.12/22-fix-sysv-init-script.patch

diff --git a/meta-networking/recipes-connectivity/samba/samba-4.1.12/22-fix-sysv-init-script.patch b/meta-networking/recipes-connectivity/samba/samba-4.1.12/22-fix-sysv-init-script.patch
new file mode 100644
index 0000000..aec3262
--- /dev/null
+++ b/meta-networking/recipes-connectivity/samba/samba-4.1.12/22-fix-sysv-init-script.patch
@@ -0,0 +1,23 @@
+--- a/packaging/sysv/samba.init
++++ b/packaging/sysv/samba.init
+@@ -21,17 +21,14 @@
+ case "$1" in
+ 
+ 'start')
+-#
+-# Edit these lines to suit your installation (paths, workgroup, host)
+-#
+-   /opt/samba/bin/smbd -D -s/opt/samba/smb.conf
+-   /opt/samba/bin/nmbd -D -l/opt/samba/log -s/opt/samba/smb.conf
++   /usr/sbin/smbd -D -s/etc/samba/smb.conf
++   /usr/sbin/nmbd -D -l/var/volatile/log/samba -s/etc/samba/smb.conf
+    ;;
+ 'stop')
+    killproc nmbd
+    killproc smbd
+    ;;
+ *)
+-   echo "Usage: /etc/init.d/samba.server { start | stop }"
++   echo "Usage: /etc/init.d/samba.sh { start | stop }"
+    ;;
+ esac
diff --git a/meta-networking/recipes-connectivity/samba/samba_4.1.12.bb b/meta-networking/recipes-connectivity/samba/samba_4.1.12.bb
index 863d783..a6c5935 100644
--- a/meta-networking/recipes-connectivity/samba/samba_4.1.12.bb
+++ b/meta-networking/recipes-connectivity/samba/samba_4.1.12.bb
@@ -34,6 +34,7 @@ SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
            file://19-systemd-daemon-is-contained-by-libsystemd.patch \
            file://20-do-not-import-target-module-while-cross-compile.patch \
            file://21-add-config-option-without-valgrind.patch \
+           file://22-fix-sysv-init-script.patch \
           "
 
 SRC_URI[md5sum] = "232016d7581a1ba11e991ec2674553c4"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [meta-networking][PATCH][jethro] samba: fix smbd and nmbd paths in sysv initscript
  2016-04-28 12:30 [meta-networking][PATCH][jethro] samba: fix smbd and nmbd paths in sysv initscript Richard Leitner
@ 2016-04-28 12:52 ` Joshua G Lock
  2016-04-28 13:59   ` Richard Leitner
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua G Lock @ 2016-04-28 12:52 UTC (permalink / raw)
  To: openembedded-devel

On Thu, 2016-04-28 at 14:30 +0200, Richard Leitner wrote:
> For the jethro branch.

Any idea whether this change is required in the master branch?

> The sysv initscript provided by samba assumes smbd and nmbd are
> installed in /opt/samba/bin/. In our case both binaries are installed
> to
> /usr/sbin/ by default. Therefore fix these paths.

Rather than hard-code these in a patch, which is equally broken for
people who don't use the default sbindir, it would make more sense to
sed ${sbindir} into the init file in a do_install_append ().

This is a fairly common pattern so you should be able to find several
examples, i.e. the bind recipe in OE-Core.

Regards,

Joshua

> 
> Furthermore fix the name of the initscript in its usage text.
> 
> Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
> ---
>  .../samba-4.1.12/22-fix-sysv-init-script.patch     | 23
> ++++++++++++++++++++++
>  .../recipes-connectivity/samba/samba_4.1.12.bb     |  1 +
>  2 files changed, 24 insertions(+)
>  create mode 100644 meta-networking/recipes-connectivity/samba/samba-
> 4.1.12/22-fix-sysv-init-script.patch
> 
> diff --git a/meta-networking/recipes-connectivity/samba/samba-
> 4.1.12/22-fix-sysv-init-script.patch b/meta-networking/recipes-
> connectivity/samba/samba-4.1.12/22-fix-sysv-init-script.patch
> new file mode 100644
> index 0000000..aec3262
> --- /dev/null
> +++ b/meta-networking/recipes-connectivity/samba/samba-4.1.12/22-fix-
> sysv-init-script.patch
> @@ -0,0 +1,23 @@
> +--- a/packaging/sysv/samba.init
> ++++ b/packaging/sysv/samba.init
> +@@ -21,17 +21,14 @@
> + case "$1" in
> + 
> + 'start')
> +-#
> +-# Edit these lines to suit your installation (paths, workgroup,
> host)
> +-#
> +-   /opt/samba/bin/smbd -D -s/opt/samba/smb.conf
> +-   /opt/samba/bin/nmbd -D -l/opt/samba/log -s/opt/samba/smb.conf
> ++   /usr/sbin/smbd -D -s/etc/samba/smb.conf
> ++   /usr/sbin/nmbd -D -l/var/volatile/log/samba
> -s/etc/samba/smb.conf
> +    ;;
> + 'stop')
> +    killproc nmbd
> +    killproc smbd
> +    ;;
> + *)
> +-   echo "Usage: /etc/init.d/samba.server { start | stop }"
> ++   echo "Usage: /etc/init.d/samba.sh { start | stop }"
> +    ;;
> + esac
> diff --git a/meta-networking/recipes-
> connectivity/samba/samba_4.1.12.bb b/meta-networking/recipes-
> connectivity/samba/samba_4.1.12.bb
> index 863d783..a6c5935 100644
> --- a/meta-networking/recipes-connectivity/samba/samba_4.1.12.bb
> +++ b/meta-networking/recipes-connectivity/samba/samba_4.1.12.bb
> @@ -34,6 +34,7 @@ SRC_URI = "${SAMBA_MIRROR}/stable/samba-
> ${PV}.tar.gz \
>             file://19-systemd-daemon-is-contained-by-libsystemd.patch 
> \
>             file://20-do-not-import-target-module-while-cross-
> compile.patch \
>             file://21-add-config-option-without-valgrind.patch \
> +           file://22-fix-sysv-init-script.patch \
>            "
>  
>  SRC_URI[md5sum] = "232016d7581a1ba11e991ec2674553c4"
> -- 
> 2.1.4
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [meta-networking][PATCH][jethro] samba: fix smbd and nmbd paths in sysv initscript
  2016-04-28 12:52 ` Joshua G Lock
@ 2016-04-28 13:59   ` Richard Leitner
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Leitner @ 2016-04-28 13:59 UTC (permalink / raw)
  To: openembedded-devel

On 04/28/2016 02:52 PM, Joshua G Lock wrote:
> On Thu, 2016-04-28 at 14:30 +0200, Richard Leitner wrote:
>> For the jethro branch.
> 
> Any idea whether this change is required in the master branch?

Yes. The Samba 4.4.2 recipe is also using the script from
packaging/LSB/samba.sh, which is the same as in 4.1.12.

> 
>> The sysv initscript provided by samba assumes smbd and nmbd are
>> installed in /opt/samba/bin/. In our case both binaries are installed
>> to
>> /usr/sbin/ by default. Therefore fix these paths.
> 
> Rather than hard-code these in a patch, which is equally broken for
> people who don't use the default sbindir, it would make more sense to
> sed ${sbindir} into the init file in a do_install_append ().

Ok, you're right, that is definitely a better solution.
I'll prepare a patch for master and jethro.

regards,
Richard


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-28 14:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-28 12:30 [meta-networking][PATCH][jethro] samba: fix smbd and nmbd paths in sysv initscript Richard Leitner
2016-04-28 12:52 ` Joshua G Lock
2016-04-28 13:59   ` Richard Leitner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.