2007-06-10 21:13:12 +01:00
|
|
|
{pkgs, samba, glibc}:
|
2007-05-28 15:09:04 +01:00
|
|
|
|
|
|
|
let
|
2007-05-28 16:39:25 +01:00
|
|
|
|
2007-06-08 16:41:12 +01:00
|
|
|
user = "smbguest";
|
|
|
|
group = "smbguest";
|
2008-01-14 11:24:36 +00:00
|
|
|
|
|
|
|
smbConfig = ./smb.conf ;
|
|
|
|
|
2007-05-28 15:09:04 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "samba";
|
|
|
|
|
2007-06-08 16:41:12 +01:00
|
|
|
users = [
|
|
|
|
{ name = user;
|
|
|
|
description = "Samba service user";
|
|
|
|
group = group;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2007-06-10 21:13:12 +01:00
|
|
|
groups = [
|
|
|
|
{ name = group;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2007-05-28 15:09:04 +01:00
|
|
|
job = "
|
|
|
|
|
|
|
|
description \"Samba Service\"
|
|
|
|
|
|
|
|
start on network-interfaces/started
|
|
|
|
stop on network-interfaces/stop
|
|
|
|
|
|
|
|
start script
|
|
|
|
|
2008-01-14 11:24:36 +00:00
|
|
|
if ! test -d /home/smbd ; then
|
|
|
|
mkdir -p /home/smbd
|
|
|
|
chown ${user} /home/smbd
|
|
|
|
chmod a+rwx /home/smbd
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! test -d /var/samba ; then
|
|
|
|
mkdir -p /var/samba/locks /var/samba/cores/nmbd /var/samba/cores/smbd /var/samba/cores/winbindd
|
|
|
|
fi
|
|
|
|
|
|
|
|
${samba}/sbin/nmbd -D -s ${smbConfig} &
|
|
|
|
${samba}/sbin/smbd -D -s ${smbConfig} &
|
|
|
|
${samba}/sbin/winbindd -B -s ${smbConfig} &
|
2007-05-28 15:09:04 +01:00
|
|
|
|
2008-01-16 21:56:31 +00:00
|
|
|
ln -fs ${smbConfig} /var/samba/config
|
|
|
|
|
2007-05-28 15:09:04 +01:00
|
|
|
end script
|
|
|
|
|
2008-01-14 11:24:36 +00:00
|
|
|
respawn ${samba}/sbin/nmbd -D -s ${smbConfig} &; ${samba}/sbin/smbd -D -s ${smbConfig} &; ${samba}/sbin/winbindd -B &
|
2007-05-28 15:09:04 +01:00
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|