There's a script which has to be run by a systemd service's ExecStartPre
. What would be the proper path to put this script into and how to specify it in the unit?
Currently using paths such as these fail (the service won't start due to bad unit file):
- script.sh
- ./script.sh
- /etc/systemd/system/script.sh
- /usr/local/sbin/script.sh
Here's the error I get in the status:
Process: 8679 ExecStartPre=/usr/local/sbin/script.sh (code=exited, status=203/EXEC)
And here's the script:
#!/bin/bash
if [ ! -e /var/log/myservice ];
then
echo "myservice's log directory doesn't exist. creating it."
mkdir /var/log/myservice
fi
ExecStartPost
orExecStartPre
? Where is the script actually located?