Added an option to easily allow everyone to use "at".

svn path=/nixos/trunk/; revision=12531
This commit is contained in:
Michael Raskin 2008-08-07 10:09:17 +00:00
parent 791d8bbc66
commit 014b33637c
3 changed files with 11 additions and 1 deletions

View File

@ -650,6 +650,14 @@
Whether to enable the `at' daemon, a command scheduler. Whether to enable the `at' daemon, a command scheduler.
''; '';
}; };
allowEveryone = mkOption {
default = false;
description = ''
Whether to make /var/spool/at{jobs,spool} writeable
by everyone (and sticky).
'';
};
}; };
locate = { locate = {

View File

@ -1,4 +1,4 @@
{ at }: { at, config }:
let uid = (import ../system/ids.nix).uids.atd; let uid = (import ../system/ids.nix).uids.atd;
gid = (import ../system/ids.nix).gids.atd; gid = (import ../system/ids.nix).gids.atd;
@ -44,6 +44,7 @@ start script
fi fi
done done
chmod 1770 "$spooldir" "$jobdir" chmod 1770 "$spooldir" "$jobdir"
${if config.allowEveryone then ''chmod a+rwxt "$spooldir" "$jobdir" '' else ""}
if [ ! -f "$etcdir"/at.deny ] if [ ! -f "$etcdir"/at.deny ]
then then
touch "$etcdir"/at.deny && \ touch "$etcdir"/at.deny && \

View File

@ -173,6 +173,7 @@ let
++ optional config.services.atd.enable ++ optional config.services.atd.enable
(import ../upstart-jobs/atd.nix { (import ../upstart-jobs/atd.nix {
at = pkgs.at; at = pkgs.at;
config = config.services.atd;
}) })
# DHCP client. # DHCP client.