systemd error with user having a dot (.) in name: Invalid user/group name or numeric ID

Viewed 1566

Linux Ubuntu 18. MariaDB 10.3. MariaDB service fails to start throwing a systemd error. The reason seems to be that the userid contains a dot (.).

systemd[1]: Invalid user/group name or numeric ID: myuser.withdot

Configuration:

The service file from MariaDB is /etc/systemd/system/mariadb.service.d/migrated.conf, and it contains:

[Service]
User=myuser.withdot
2 Answers

A simple solution that seems to be working, is replacing the user name with id:

id myuser.withdot
uid=12345(myuser.withdot) ...

Replace the user name with id in the systemd config file:

[Service]
User=m12345

Reload the config file:

sudo systemctl daemon-reload

Restart the service:

sudo service mariadb start

In my case, dot included username is valid which is converted with 'id' command without alphabet character in 'User' value. i.e. numeric uid value, after 'id' command returns.

Related