2007-05-28 17:39:25 +02:00
|
|
|
{pkgs, samba, glibc, pwdutils}:
|
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";
|
|
|
|
|
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-05-28 16:09:04 +02:00
|
|
|
job = "
|
|
|
|
|
|
|
|
description \"Samba Service\"
|
|
|
|
|
|
|
|
start on network-interfaces/started
|
|
|
|
stop on network-interfaces/stop
|
|
|
|
|
|
|
|
start script
|
|
|
|
|
2007-06-08 17:41:12 +02:00
|
|
|
if ! ${glibc}/bin/getent group ${group} > /dev/null; then
|
|
|
|
${pwdutils}/sbin/groupadd ${group}
|
|
|
|
fi
|
2007-05-28 16:09:04 +02:00
|
|
|
|
2007-06-08 17:41:12 +02:00
|
|
|
${samba}/sbin/nmbd -D &
|
|
|
|
${samba}/sbin/smbd -D &
|
|
|
|
${samba}/sbin/winbindd -B &
|
2007-05-28 16:09:04 +02:00
|
|
|
|
|
|
|
end script
|
|
|
|
|
|
|
|
respawn ${samba}/sbin/nmbd -D &; ${samba}/sbin/smbd -D &; ${samba}/sbin/winbindd -B &
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|