>> The umask that almost every Unix distribution has always had in /etc/profile - which is 022.
>
> /etc/profile is a configuration file for login shell.
>
> There are processes which is not started via login shell, such as
> daemons, cron jobs, etc.

To clarify. the problem is only happen when the process was not
started via login shell _and_ the parent process didn't set umask at
all.

Example, distro's init.d script set umask to 022 before forking
damons. It gurantee
umask is sane whenever a daemon startup script don't change umask insane value.

ex, RHEL6
 /etc/init.d/functions line 9

 # Make sure umask is sane
 umask 022


crond is affected this setting too. That's the reason why I'd like to
see concreate example on modern OSs.

Thanks.