2007-05-28 16:39:25 +01:00
|
|
|
{pkgs, samba, glibc, pwdutils}:
|
2007-05-28 15:09:04 +01:00
|
|
|
|
|
|
|
let
|
2007-05-28 16:39:25 +01:00
|
|
|
|
2007-05-28 15:09:04 +01:00
|
|
|
user="smbguest";
|
|
|
|
group="smbguest";
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "samba";
|
|
|
|
|
|
|
|
job = "
|
|
|
|
|
|
|
|
description \"Samba Service\"
|
|
|
|
|
|
|
|
start on network-interfaces/started
|
|
|
|
stop on network-interfaces/stop
|
|
|
|
|
|
|
|
start script
|
|
|
|
|
|
|
|
if ! ${glibc}/bin/getent group ${group} > /dev/null; then
|
|
|
|
${pwdutils}/sbin/groupadd ${group}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! ${glibc}/bin/getent passwd ${user} > /dev/null; then
|
|
|
|
${pwdutils}/sbin/useradd -g ${group} -d /var/empty -s /noshell -c 'Samba service user' ${user}
|
|
|
|
fi
|
|
|
|
|
|
|
|
${samba}/sbin/nmbd -D &
|
|
|
|
${samba}/sbin/smbd -D &
|
|
|
|
${samba}/sbin/winbindd -B &
|
|
|
|
|
|
|
|
end script
|
|
|
|
|
|
|
|
respawn ${samba}/sbin/nmbd -D &; ${samba}/sbin/smbd -D &; ${samba}/sbin/winbindd -B &
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
}
|