2

I am on Arch Linux and have this service named toto.service in /etc/systemd/system/ that I want to run:

[Unit]
Description=Toto
After=network-online.target

[Service] ExecStart=/opt/toto.sh

[Install] WantedBy=multi-user.target

Where toto.sh contains:

#!/bin/bash

echo toto

And when I start it, it fails with the following error as follows:

Jun 13 00:11:15 scx systemd[1]: Started Toto.
Jun 13 00:11:15 scx (test.sh)[14097]: toto.service: Failed to locate executable /opt/toto/toto.sh: No such file or directory
Jun 13 00:11:15 scx (test.sh)[14097]: spark.service: Failed at step EXEC spawning /opt/toto/toto.sh: No such file or directory
Jun 13 00:11:15 scx systemd[1]: toto.service: Main process exited, code=exited, status=203/EXEC
Jun 13 00:11:15 scx systemd[1]: toto.service: Failed with result 'exit-code'.

Why doesn’t it find /opt/toto/toto.sh?

Giacomo1968
  • 58,727
moth
  • 135

1 Answers1

1

I don't know why it permission errors on calling the script, but the workaround which worked for me is to call bash first:

ExecStart=bash /opt/toto.sh
reukiodo
  • 200