Install fails when umask=077

Fresh install of Raspbian Buster on RPi4, but I changed umask from 022 to 077 as part of my post-install customisations. The install script fails every time at "Failed to install Node.js - Exit" without anything helpful in the log. It wasn't until I checked where the npm link in /usr/bin went that I realised that some dirs were not accessible to user pi. I fixed it by "chmod -R go+rX /usr/lib/node_modules/" (and setting umask=022 for now) and running the script again which then finished successfully.

I think umask=077 is a sane setting on any multiuser system and it would be good if the install script tried to anticipate umask settings other than 022. Thanks for all your efforts!

Well we could save the existing value - unset it - install - then reset it. But if the script was stopped half way through or exited uncleanly then it would be left in a state the user was unaware of... safest option would be to check and then just warn the user and abort if not 0022 ?
If you know of a better way then a proposal or a Pull Request would be much appreciated. thanks

The solution is straightforward: just set umask to your desired value in the process (script), e.g. "umask 022". It is valid only for the script and its subprocesses. Afterwards, the umask value of the shell remains unchanged.

OK - will test that and implement. thanks

1 Like