Working directory

Directory used as the service process current working directory. This writes WorkingDirectory=.

Use an absolute path, such as /srv/myapp. A path beginning with ~ is also accepted by systemd for the service user's home directory, and a leading - makes a missing directory non-fatal.

This is useful for applications that load relative configuration files or assets.

For user units, use a directory that belongs to the selected user, typically below that user's home directory.