nixpkgs/upstart-jobs/samba.nix

44 lines
642 B
Nix
Raw Normal View History

{pkgs, samba, glibc, pwdutils}:
let
user = "smbguest";
group = "smbguest";
in
{
name = "samba";
users = [
{ name = user;
description = "Samba service user";
group = group;
}
];
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
${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 &
";
}