0

I 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 does it not find /opt/toto/toto.sh?

OS: Arch Linux

moth
  • 115
  • 4
  • you didn't indicate if the file was marked as executable and if the user the service is supposed to run under has access to it. My guess is the latter being that the user the service is spawned under can't see the file. Try logging in as that user (a simple passwd hack) and see if you can see said file when logging in as that user. – Señor CMasMas Jun 12 '23 at 22:51
  • On second thought.. after looking at your service file, you don't even specify what user you want this to run as. Have you considered that? – Señor CMasMas Jun 12 '23 at 22:56
  • Study https://superuser.com/questions/1176200/no-such-file-when-it-exists/1176328#1176328 – sawdust Jun 13 '23 at 03:31

0 Answers0