I thought, that the service files under /lib/systemd/system/ determine as what user a service is started. But apparently that's not (always) the case. Here's an example:
~# ps faux
...
whoopsie 1445 0.0 0.1 388420 12604 ? Ssl 08:22 0:00 /usr/bin/whoopsie -f
...
From the above output we see, that the process 'whoopsie' runs under the user 'whoopsie'
Now we look at the startupscript:
~# cat /lib/systemd/system/whoopsie.service
Description=crash report submission daemon
After=network-online.target
Wants=network-online.target
[Service]
Environment="CRASH_DB_URL=https://daisy.ubuntu.com"
ExecStart=/usr/bin/whoopsie -f
Restart=always
[Install]
WantedBy=multi-user.target
In that startup script is no user defined.
So what determines as which user a process is started?