* 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
This commit is contained in:
Eelco Dolstra 2010-12-06 19:03:32 +00:00
parent c4d731f52b
commit 04ec671c8a

View file

@ -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
'';