unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24834: Samba commands expect configuration file inside store
@ 2016-10-31 10:17 Adonay Felipe Nogueira
  2016-11-03 13:38 ` Ludovic Courtès
  2016-12-04  0:06 ` Adonay Felipe Nogueira
  0 siblings, 2 replies; 8+ messages in thread
From: Adonay Felipe Nogueira @ 2016-10-31 10:17 UTC (permalink / raw)
  To: 24834

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

# Begin of terminal interaction
$ strace ".guix-profile/sbin/samba/smbd"
stat64("/gnu/store/...-samba-4.5.0/etc/samba/smb.conf", 0xbfeb41b0) = -1
ENOENT (No such file or directory)
open("/gnu/store/...-samba-4.5.0/etc/samba/smb.conf", O_RDONLY|
O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2001, ...}) = 0
exit_group(1)                           = ?
+++ exited with 1 +++
# End of terminal interaction

Sorry for my brevity, I'll return to this issue at a later time.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

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

* bug#24834: Samba commands expect configuration file inside store
  2016-10-31 10:17 bug#24834: Samba commands expect configuration file inside store Adonay Felipe Nogueira
@ 2016-11-03 13:38 ` Ludovic Courtès
  2016-11-18  9:50   ` Adonay Felipe Nogueira
  2016-12-04  0:06 ` Adonay Felipe Nogueira
  1 sibling, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2016-11-03 13:38 UTC (permalink / raw)
  To: Adonay Felipe Nogueira; +Cc: 24834

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

Adonay Felipe Nogueira <adfeno@openmailbox.org> skribis:

> # Begin of terminal interaction
> $ strace ".guix-profile/sbin/samba/smbd"
> stat64("/gnu/store/...-samba-4.5.0/etc/samba/smb.conf", 0xbfeb41b0) = -1

Presumably part of the solution is the attached patch, but very often
‘make install’ tries to mkdir $(sysconfdir), so a bit of additional work
may be needed.

Can you look into it?

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 586 bytes --]

diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm
index 1706ec3..447720c 100644
--- a/gnu/packages/samba.scm
+++ b/gnu/packages/samba.scm
@@ -121,6 +121,7 @@ anywhere.")
                        ;; XXX: heimdal not packaged.
                        "--bundled-libraries=com_err"
                        (string-append "--prefix=" out)
+                       "--sysconfdir=/etc"
                        ;; Install public and private libraries into
                        ;; a single directory to avoid RPATH issues.
                        (string-append "--libdir=" libdir)

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

* bug#24834: Samba commands expect configuration file inside store
  2016-11-03 13:38 ` Ludovic Courtès
@ 2016-11-18  9:50   ` Adonay Felipe Nogueira
  2016-11-23 10:44     ` Adonay Felipe Nogueira
  2016-11-23 10:52     ` Adonay Felipe Nogueira
  0 siblings, 2 replies; 8+ messages in thread
From: Adonay Felipe Nogueira @ 2016-11-18  9:50 UTC (permalink / raw)
  To: 24834

Thank you for the suggestion!

I'll reinstall Samba from Guix here, and will test it.

I plan to do so this weekend.


Respectfully, Adonay.

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

* bug#24834: Samba commands expect configuration file inside store
  2016-11-18  9:50   ` Adonay Felipe Nogueira
@ 2016-11-23 10:44     ` Adonay Felipe Nogueira
  2016-11-23 22:16       ` Ludovic Courtès
  2016-11-23 10:52     ` Adonay Felipe Nogueira
  1 sibling, 1 reply; 8+ messages in thread
From: Adonay Felipe Nogueira @ 2016-11-23 10:44 UTC (permalink / raw)
  To: 24834

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

Tested the patch today

It seems that, during the `install' phase, something tries to make
"/etc/samba" directory.

The log from the start of the error is attached.

I did `guix build samba` as normal user, and since I'm new to this
situation, I must ask: should I run it as root instead? Or should we
find a way to tell the `install' phase to not make such paths? Or, do
you have other ideas?

[-- Attachment #2: guix build samba.log --]
[-- Type: application/octet-stream, Size: 2240 bytes --]

Waf: Leaving directory `/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/bin'
'build' finished successfully (12m43.849s)
phase `build' succeeded after 764.2 seconds
starting phase `check'
test suite not run   
phase `check' succeeded after 0.0 seconds
starting phase `install'
WAF_MAKE=1 python ./buildtools/bin/waf install
Waf: Entering directory `/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/bin'
* creating /etc/samba
/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/wscript: error: Traceback (most re
cent call last):
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/U
tils.py", line 669, in recurse
    exec(compile(txt, file_path, 'exec'), dc)
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/wscript_build", line 47, i
n <module>
    bld.RECURSE('dynconfig')
  File "./buildtools/wafsamba/samba_utils.py", line 453, in RECURSE
    return ctx.add_subdirs(relpath)
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/Build.py", line 997, in add_subdirs
    self.recurse(dirs, 'build')
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/Utils.py", line 656, in recurse
    f(self)
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/dynconfig/wscript", line 423, in build
    bld.INSTALL_DIRS("", "${CONFIGDIR} ${PRIVATE_DIR} ${LOGFILEBASE}");
  File "./buildtools/wafsamba/wafsamba.py", line 889, in INSTALL_DIRS
    bld.install_dir(os.path.join(destdir, d))
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/Build.py", line 844, in install_dir
    Utils.check_dir(destpath)
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/Utils.py", line 458, in check_dir
    raise WafError("Cannot create the folder '%s' (error: %s)" % (path, e))
WafError: Cannot create the folder '/etc/samba' (error: [Errno 13] Permission denied: '/etc/samba')  

make: *** [Makefile:11: install] Error 1
phase `install' failed after 0.5 seconds
builder for `/gnu/store/...-samba-4.5.1.drv' failed with exit code 1
@ build-failed /gnu/store/...-samba-4.5.1.drv - 1 builder for `/gnu/store/...-samba-4.5.1.drv' failed with exit code 1
guix build: error: build failed: build of `/gnu/store/...-samba-4.5.1.drv' failed

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

* bug#24834: Samba commands expect configuration file inside store
  2016-11-18  9:50   ` Adonay Felipe Nogueira
  2016-11-23 10:44     ` Adonay Felipe Nogueira
@ 2016-11-23 10:52     ` Adonay Felipe Nogueira
  1 sibling, 0 replies; 8+ messages in thread
From: Adonay Felipe Nogueira @ 2016-11-23 10:52 UTC (permalink / raw)
  To: 24834

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

Tested the patch today

It seems that, during the `install' phase, something tries to make
"/etc/samba" directory.

The log from the start of the error is attached.

I did `guix build samba` as normal user, and since I'm new to this
situation, I must ask: should I run it as root instead? Or should we
find a way to tell the `install' phase to not make such paths? Or, do
you have other ideas?

[-- Attachment #2: guix build samba.log --]
[-- Type: application/octet-stream, Size: 2240 bytes --]

Waf: Leaving directory `/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/bin'
'build' finished successfully (12m43.849s)
phase `build' succeeded after 764.2 seconds
starting phase `check'
test suite not run   
phase `check' succeeded after 0.0 seconds
starting phase `install'
WAF_MAKE=1 python ./buildtools/bin/waf install
Waf: Entering directory `/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/bin'
* creating /etc/samba
/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/wscript: error: Traceback (most re
cent call last):
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/U
tils.py", line 669, in recurse
    exec(compile(txt, file_path, 'exec'), dc)
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/wscript_build", line 47, i
n <module>
    bld.RECURSE('dynconfig')
  File "./buildtools/wafsamba/samba_utils.py", line 453, in RECURSE
    return ctx.add_subdirs(relpath)
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/Build.py", line 997, in add_subdirs
    self.recurse(dirs, 'build')
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/Utils.py", line 656, in recurse
    f(self)
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/dynconfig/wscript", line 423, in build
    bld.INSTALL_DIRS("", "${CONFIGDIR} ${PRIVATE_DIR} ${LOGFILEBASE}");
  File "./buildtools/wafsamba/wafsamba.py", line 889, in INSTALL_DIRS
    bld.install_dir(os.path.join(destdir, d))
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/Build.py", line 844, in install_dir
    Utils.check_dir(destpath)
  File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/Utils.py", line 458, in check_dir
    raise WafError("Cannot create the folder '%s' (error: %s)" % (path, e))
WafError: Cannot create the folder '/etc/samba' (error: [Errno 13] Permission denied: '/etc/samba')  

make: *** [Makefile:11: install] Error 1
phase `install' failed after 0.5 seconds
builder for `/gnu/store/...-samba-4.5.1.drv' failed with exit code 1
@ build-failed /gnu/store/...-samba-4.5.1.drv - 1 builder for `/gnu/store/...-samba-4.5.1.drv' failed with exit code 1
guix build: error: build failed: build of `/gnu/store/...-samba-4.5.1.drv' failed

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

* bug#24834: Samba commands expect configuration file inside store
  2016-11-23 10:44     ` Adonay Felipe Nogueira
@ 2016-11-23 22:16       ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2016-11-23 22:16 UTC (permalink / raw)
  To: Adonay Felipe Nogueira; +Cc: 24834

Hi,

Adonay Felipe Nogueira <adfeno@openmailbox.org> skribis:

> Tested the patch today
>
> It seems that, during the `install' phase, something tries to make
> "/etc/samba" directory.

[...]

>   File "/tmp/guix-build-samba-4.5.1.drv-0/samba-4.5.1/third_party/waf/wafadmin/Utils.py", line 458, in check_dir
>     raise WafError("Cannot create the folder '%s' (error: %s)" % (path, e))
> WafError: Cannot create the folder '/etc/samba' (error: [Errno 13] Permission denied: '/etc/samba')  
>
> make: *** [Makefile:11: install] Error 1
> phase `install' failed after 0.5 seconds

That’s a common issue as I mentioned in
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24834#8> (‘sysconfdir’
corresponds to /etc here.)

Do address it, we need to modify Samba’s build system to not attempt to
create /etc.  Samba uses Waf, so we’d have to comment out the Waf bit
that leads to this attempt to create /etc.  I’m not familiar with Waf so
I’d “grep -r” in the source.  :-)

Could you look into it?

There are similar cases in gnu/packages/*.scm but the fix always depends
on the specifics of the build system being used, so nothing that really
helps here I’m afraid.

Thanks,
Ludo’.

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

* bug#24834: Samba commands expect configuration file inside store
  2016-10-31 10:17 bug#24834: Samba commands expect configuration file inside store Adonay Felipe Nogueira
  2016-11-03 13:38 ` Ludovic Courtès
@ 2016-12-04  0:06 ` Adonay Felipe Nogueira
  2016-12-07 23:29   ` Ludovic Courtès
  1 sibling, 1 reply; 8+ messages in thread
From: Adonay Felipe Nogueira @ 2016-12-04  0:06 UTC (permalink / raw)
  To: 24834

[-- Attachment #1: Type: text/plain, Size: 126 bytes --]

Here's a patch that tries to fix this issue. I already tested it, but
please do so also just in case.


Respectfully, Adonay.

[-- Attachment #2: guix.patch --]
[-- Type: text/x-diff, Size: 2188 bytes --]

From 086396d33e113a6d991b7c63063844c66a5610ca Mon Sep 17 00:00:00 2001
From: Adonay Felipe Nogueira <adfeno@openmailbox.org>
Date: Sat, 3 Dec 2016 21:22:56 -0200
Subject: [PATCH] gnu: samba: Don't expect configuration files inside the
 store.

Attempts to fix <https://bugs.gnu.org/24834>.

* gnu/packages/samba.scm (samba) [arguments]:
  * Set `--sysconfdir` to "/etc".
  * Avoid creation of "/etc/samba" (otherwise would require root).
---
 gnu/packages/samba.scm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm
index 1706ec3..6a27a63 100644
--- a/gnu/packages/samba.scm
+++ b/gnu/packages/samba.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 Adonay "adfeno" Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -121,11 +122,17 @@ anywhere.")
                        ;; XXX: heimdal not packaged.
                        "--bundled-libraries=com_err"
                        (string-append "--prefix=" out)
+		       ;; Don't write to store.
+		       "--sysconfdir=/etc"
                        ;; Install public and private libraries into
                        ;; a single directory to avoid RPATH issues.
                        (string-append "--libdir=" libdir)
-                       (string-append "--with-privatelibdir=" libdir)))))))
-
+                       (string-append "--with-privatelibdir=" libdir))))))
+	 (add-before 'install 'disable-etc-samba-directory-creation
+		     (lambda _
+		       (substitute* "dynconfig/wscript"
+				      (("bld\\.INSTALL_DIRS\\(\"\",[[:blank:]]{1,}\"\\$\\{CONFIGDIR\\}[[:blank:]]{1,}")
+				       "bld.INSTALL_DIRS(\"\", \"")))))
        ;; XXX: The test infrastructure attempts to set password with
        ;; smbpasswd, which fails with "smbpasswd -L can only be used by root."
        ;; So disable tests until there's a workaround.
-- 
1.9.1


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

* bug#24834: Samba commands expect configuration file inside store
  2016-12-04  0:06 ` Adonay Felipe Nogueira
@ 2016-12-07 23:29   ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2016-12-07 23:29 UTC (permalink / raw)
  To: Adonay Felipe Nogueira; +Cc: 24834-done

Adonay Felipe Nogueira <adfeno@openmailbox.org> skribis:

> Here's a patch that tries to fix this issue. I already tested it, but
> please do so also just in case.
>
>
> Respectfully, Adonay.
>
> From 086396d33e113a6d991b7c63063844c66a5610ca Mon Sep 17 00:00:00 2001
> From: Adonay Felipe Nogueira <adfeno@openmailbox.org>
> Date: Sat, 3 Dec 2016 21:22:56 -0200
> Subject: [PATCH] gnu: samba: Don't expect configuration files inside the
>  store.
>
> Attempts to fix <https://bugs.gnu.org/24834>.
>
> * gnu/packages/samba.scm (samba) [arguments]:
>   * Set `--sysconfdir` to "/etc".
>   * Avoid creation of "/etc/samba" (otherwise would require root).

Apply with commit log and indentation tweaks.  It builds fine here.

Thank you!

Ludo’.

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

end of thread, other threads:[~2016-12-07 23:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-31 10:17 bug#24834: Samba commands expect configuration file inside store Adonay Felipe Nogueira
2016-11-03 13:38 ` Ludovic Courtès
2016-11-18  9:50   ` Adonay Felipe Nogueira
2016-11-23 10:44     ` Adonay Felipe Nogueira
2016-11-23 22:16       ` Ludovic Courtès
2016-11-23 10:52     ` Adonay Felipe Nogueira
2016-12-04  0:06 ` Adonay Felipe Nogueira
2016-12-07 23:29   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).