1

So, I have start.sh file to start imagecache service. And I have executable binary file "imgproxy" and I need start it and pass to it two parameters like as text file. Body of start.sh file:

export IMGPROXY_LOCAL_FILESYSTEM_ROOT="/home/filestorage/media"
export IMGPROXY_BIND=":9608"
./home/tools/imgproxy/imgproxy -keypath ./home/tools/imgproxy/key.txt -saltpath 
./home/tools/imgproxy/salt.txt

ExecStartPre=nohup /bin/bash /home/tools/imgproxy/start.sh </dev/null >/dev/null 2>&1 &

I starts it with command "ExecStartPre" because I have main service and binary file their dependency. I must start this binary file before starting my main service.

So, when I start service appears following error:

systemd[1]: [/etc/systemd/system/imagecache.service:11] Executable path is not absolute, ignoring: nohup bash /home/tools...ull 2>&1 &

Anybody know how to fix it?

Thank you in advance.

SBotirov
  • 25
  • 1
  • 8

1 Answers1

1

An absolute path is the full path to a file starting at the root /. It looks like you need to supply the absolute path of nohup which on a CentOS 7 system is /usr/bin/nohup.


I really don't know the tools you are using but if possible I would be tempted to make the target of the ExecPreStart its own service and make the main service dependent on it. The docs for systemd.service are well worth a read.

hjpotter92
  • 660
  • 1
  • 10
  • 20
user9517
  • 114,104
  • 20
  • 206
  • 289