Comment 21 for bug 1685754

Revision history for this message
Michael Shannon (mrshannon-aerospace) wrote : Re: gnome-terminal unduly forces umask=0022

This is a bug in every GNOME application that uses systemctl --user to start itself. There is currently no sane fix because systemd is missing a feature of upstart, umask inheritance. GNOME could abuse systemd's instantiated services feature to pass the umask through this but this would be far from ideal.

A workaround for those of us that need a solution now is to place

  [Service]
  UMask=<umask value>

in

  $HOME/.config/systemd/user/gnome-terminal-server.service.d/umask.conf

for an individual user or in

  /etc/systemd/user/gnome-terminal-server.service.d/umask.conf

for all users. This will set the umask only for gnome-terminal. To get most services set an override for dbus.service as well. However, there are quite a few services that are not directly launched by dbus (like gnome-terminal-server) and need their own overrides. A list of these can be obtained by:

  $ grep -rhoP '(?<=SystemdService=).*' /usr/share/dbus-1/services

The only sane way I have come up with to deal with this is to create a single umask.conf and add a symlink to it from the <service>.serivce.d/umask.conf overide for each service found above (as well as dbus). In this way, only two files must be edited to set system default umask, /etc/login.defs and umask.conf.