Systemd Service Not Starting (status=217/USER)

A systemd service may fail to start with the error:

Main process exited, code=exited, status=217/USER

The status=217/USER indicates that the user that is configured to run the service could not be found.

This could happen if there is a typo in a username or you have copied a service file from another machine and it contains the user that doesn’t exists on your system.

This also could happen if the user that should run the service is not the local one but comes from some external authentication provider, like LDAP or Active Directory.

This short note shows how to fix the “Main process exited, code=exited, status=217/USER” error for such external user. (more…)

Journalctl: Tail Service Logs – Systemd Journal

Journalctl is a command line tool in Linux for querying and displaying logs from journald, systemd’s logging service.

In this note i will show how to use journalctl to tail systemd service logs (display last 100 lines or follow) and how to show logs for particular time rages: today’s logs, previous boot logs or systemd service logs for specific date and time. (more…)

Systemd: Service File Examples

Most Linux distributions use systemd as a system and service manager.

The systemctl is the main command in systemd, used to control services.

In this tutorial i will show how to create a systemd service file that will allow you to control your service using the systemctl command, how to restart systemd without reboot to reload unit files and how to enable your new service.

I will also show and describe the most important systemd service file options with the live examples of the systemd service files. (more…)