Merge pull request #121394 from bjornfor/atd-file-creation
nixos/atd: prefer 'install' over 'mkdir/chmod/chown'
This commit is contained in:
commit
4cbe186a8a
@ -81,14 +81,9 @@ in
|
|||||||
jobdir=/var/spool/atjobs
|
jobdir=/var/spool/atjobs
|
||||||
etcdir=/etc/at
|
etcdir=/etc/at
|
||||||
|
|
||||||
for dir in "$spooldir" "$jobdir" "$etcdir"; do
|
install -dm755 -o atd -g atd "$etcdir"
|
||||||
if [ ! -d "$dir" ]; then
|
spool_and_job_dir_perms=${if cfg.allowEveryone then "1777" else "1770"}
|
||||||
mkdir -p "$dir"
|
install -dm"$spool_and_job_dir_perms" -o atd -g atd "$spooldir" "$jobdir"
|
||||||
chown atd:atd "$dir"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
chmod 1770 "$spooldir" "$jobdir"
|
|
||||||
${if cfg.allowEveryone then ''chmod a+rwxt "$spooldir" "$jobdir" '' else ""}
|
|
||||||
if [ ! -f "$etcdir"/at.deny ]; then
|
if [ ! -f "$etcdir"/at.deny ]; then
|
||||||
touch "$etcdir"/at.deny
|
touch "$etcdir"/at.deny
|
||||||
chown root:atd "$etcdir"/at.deny
|
chown root:atd "$etcdir"/at.deny
|
||||||
|
Loading…
Reference in New Issue
Block a user