For testing purposes a systemd service file is meant to execute a simple bash script. I want the service to be started by a "system" user. The bash script is owned by this system user and has granted execution permission.
The Service file is simply:
[Unit] Description=Come one step closer After=network-online.target Requires=network-online.target [Service] User=test1 Group=test1 Type=simple ExecStart=/usr/bin/bash /absolute/path/to/test.sh [Install] WantedBy=multi-user.target
The test.sh script should simply give out a message to journalctl - it is just for testing.
I reloaded the systemd unit files with:
$ sudo systemctl daemon-reload
I started the service with:
$ sudo systemctl start tester.service
The output of systemctl status tester.service yields, that there is no permission for the bash execution.
I added the "system" user test1 like that to the system:
$ sudo useradd -r -s /usr/bin/bash test1 -U
What do I need to do for user test1 to get permission to start the service. I cannot test the bash script with user test1, because as test1 being a system user I cannot log in as test1.