Linux – what causes “systemd: Failed at step USER spawning /usr/sbin/opendkim: No such process”

centoslinuxsystemd

How can I remove following error:

systemd: Failed at step USER spawning /usr/sbin/opendkim: No such process

It occurs when I try to start opendkim service on Centos.

Best Answer

I've just ran into this and in my case it was caused by quoting a user name in my service file:

[Unit]
Description=Demonstrate Failed at step USER spawning ...: No such process error when user name is quoted

[Service]
User="tadeusz"
ExecStart=/bin/echo hello

[Install]
WantedBy=multi-user.target

Starting this service on Ubuntu 16.04.2 LTS (Amazon EC2 instance) would fail with following error:

user-example.service: Failed at step USER spawning /bin/echo: No such process

Interestingly, on Ubuntu Gnome 17.04 (my local machine), the error message is much more helpful:

[/etc/systemd/system/user-example.service:5] Invalid user/group name or numeric ID, ignoring: "tadeusz"

Removing quotes in both environments resolved the problem:

[Service]
User=tadeusz
Related Question