16

I am attempting to create a "Hello World" service, so to speak. It is called autologger.service and is store at /usr/lib/systemd/system/autologger.service.

I attempted sudo service autologger start, but systemctl returned the standard:

Job for autologger.service failed. See 'systemctl status
autologger.service' and 'journalctl -xn' for details.

When I checked /var/log/messages, I saw the following error message:

Failed at step EXEC spawning /opt/autologger/placeholder.sh: Permission denied

My question is: how do I give a service permissions to anything?

Here is the service unit file:

[Unit]
Description=Hello World
DefaultDependencies=no
Before=shutdown.target reboot.target halt.target


[Service]
Type=oneshot
ExecStart=/opt/autologger/placeholder.sh

placeholder.sh simply contains

#!/bin/bash
echo "Hello World"
19

I forgot the fundamentals....

chmod +x placeholder.sh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.