I'm trying to start a service which runs this script, which is just flags for a binary file
This is the script:
./geth_linux --config ./config.toml --datadir ./mainnet --cache 100000 \
--rpc.allow-unprotected-txs --txlookuplimit 0 --http --ws \
--maxpeers 100 --syncmode=snap --snapshot=false --diffsync
When I run this script in terminal from the binary's directory /home/bsc, it runs as I want it to.
When I start the service though, I get this error:
(code=exited, status=203/EXEC)
Here is my .service file:
[Unit]
Description=BSC Full Node
[Service]
User=bsc
Type=simple
WorkingDirectory=/home/bsc
ExecStart=/home/bsc/start.sh
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
I have made this script executable with:
chmod +x /home/bsc/start.sh
Also i have run:
chown +R bsc.bsc /home/bsc/*
I also tried running ExecStart=/bin/bash /home/bsc/start.sh
and also adding #!/bin/bash at the top line of the script but failed also.
I'm stumped.
Ubuntu 20.04.3 LTS
systemd error log
Nov 24 04:25:14 rezonautik systemd[1]: Started BSC Full Node.
Nov 24 04:25:14 rezonautik bash[26939]: /home/bsc/start.sh: line 1: geth: command not found
Nov 24 04:25:14 rezonautik systemd[1]: bsc.service: Main process exited, code=exited, status=127/n/a
Nov 24 04:25:14 rezonautik systemd[1]: bsc.service: Failed with result 'exit-code'.
Nov 24 04:25:19 rezonautik systemd[1]: bsc.service: Scheduled restart job, restart counter is at 1.
Nov 24 04:25:19 rezonautik systemd[1]: Stopped BSC Full Node.
Nov 24 04:25:19 rezonautik systemd[1]: Started BSC Full Node.
Nov 24 04:25:19 rezonautik bash[26981]: /home/bsc/start.sh: line 1: geth: command not found
Nov 24 04:25:19 rezonautik systemd[1]: bsc.service: Main process exited, code=exited, status=127/n/a
/usr/bin/strace -f ./geth_linux ... 2>&1and add the (last 30 lines of the) output (systemctl status servicename -n 40) to your question (or usestrace -o /path/to/filenamefor dumping the output to a file)../geth_linuxscript contents? I'm asking because of/home/bsc/start.sh: line 1: geth: command not founderror, which mentionsgeth(without the "linux" part) and I have a feeling this is some kind of a PATH problem.