Unverified Commit 361c7f79 authored by Victor Engmark's avatar Victor Engmark
Browse files

nixos/cron: Fix ShellCheck issue in preStart script

Fixes the following warning when setting
`systemd.enableStrictShellChecks = true`:

> SC2174 (warning): When used with -p, -m only applies to the deepest
> directory.

Since it could conceivably be possible for `/var` to not exist when
running this script, the fix also explicitly tries to create /var with
the normal 0755 permissions.
parent a1945f76
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -125,7 +125,8 @@ in
        wantedBy = [ "multi-user.target" ];

        preStart = ''
          mkdir -m 710 -p /var/cron
          (umask 022 && mkdir -p /var)
          (umask 067 && mkdir -p /var/cron)

          # By default, allow all users to create a crontab.  This
          # is denoted by the existence of an empty cron.deny file.