nixpkgs/upstart-jobs/samba.nix
Wouter den Breejen 2e50d9cd58 nixos dir: Xserver and samba nixos
svn path=/nixos/trunk/; revision=8784
2007-05-28 14:09:04 +00:00

40 lines
678 B
Nix

{samba, glibc, pwdutils}:
let
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 &
";
}