2007-06-10 22:13:12 +02:00
|
|
|
{pkgs, samba, glibc}:
|
2007-05-28 16:09:04 +02:00
|
|
|
|
|
|
|
let
|
2007-05-28 17:39:25 +02:00
|
|
|
|
2007-06-08 17:41:12 +02:00
|
|
|
user = "smbguest";
|
|
|
|
group = "smbguest";
|
2008-01-14 12:24:36 +01:00
|
|
|
|
|
|
|
smbConfig = ./smb.conf ;
|
|
|
|
|
2007-05-28 16:09:04 +02:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "samba";
|
|
|
|
|
2007-06-08 17:41:12 +02:00
|
|
|
users = [
|
|
|
|
{ name = user;
|
|
|
|
description = "Samba service user";
|
|
|
|
group = group;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2007-06-10 22:13:12 +02:00
|
|
|
groups = [
|
|
|
|
{ name = group;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2007-05-28 16:09:04 +02:00
|
|
|
job = "
|
|
|
|
|
|
|
|
description \"Samba Service\"
|
|
|
|
|
|
|
|
start on network-interfaces/started
|
|
|
|
stop on network-interfaces/stop
|
|
|
|
|
|
|
|
start script
|
|
|
|
|
2008-01-14 12:24:36 +01: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 16:09:04 +02:00
|
|
|
|
|
|
|
end script
|
|
|
|
|
2008-01-14 12:24:36 +01:00
|
|
|
respawn ${samba}/sbin/nmbd -D -s ${smbConfig} &; ${samba}/sbin/smbd -D -s ${smbConfig} &; ${samba}/sbin/winbindd -B &
|
2007-05-28 16:09:04 +02:00
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|