From 04ec671c8a809d987eeb79d69dd51377f907f29a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 6 Dec 2010 19:03:32 +0000 Subject: [PATCH] * Run smbd in its own session / process group (setsid) because smbd now kills its process group when it exits. Without setsid, this ends up killing the parent (i.e., the builder). * Use port 445 instead of 139 because the CIFS kernel module tries port 445 first. If there is an actual Samba running on the host, it would end up connecting to that one instead of our own and fail. svn path=/nixpkgs/trunk/; revision=25017 --- pkgs/build-support/vm/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 5e0d77129c5..4e63d8082c3 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -216,7 +216,7 @@ rec { -nographic -no-reboot \ -net nic,model=virtio \ -chardev socket,id=samba,path=./samba \ - -net user,guestfwd=tcp:10.0.2.4:139-chardev:samba \ + -net user,guestfwd=tcp:10.0.2.4:445-chardev:samba \ -drive file=$diskImage,if=virtio,boot=on,cache=writeback,werror=report \ -kernel ${kernel}/bzImage \ -initrd ${initrd}/initrd \ @@ -247,7 +247,7 @@ rec { SMB rm -f ./samba - ${socat}/bin/socat unix-listen:./samba exec:"${samba}/sbin/smbd -s $TMPDIR/smb.conf",nofork > /dev/null 2>&1 & + ${socat}/bin/socat unix-listen:./samba exec:"${utillinux}/bin/setsid ${samba}/sbin/smbd -s $TMPDIR/smb.conf",nofork > /dev/null 2>&1 & while [ ! -e ./samba ]; do sleep 0.1; done # ugly '';