myapp.service failed with status=200/chdir. the script runs fine by hand! !!

Solvedlinuxservicessystemd4 replies · 327 views · started
Accepted solution by Freya S. — yeahhh if its flapping, check Restart= and StartLimitIntervalSec=/StartLimitBurst=. After hitting teh limit, clear it with sudo systemctl…
  1. not gonna lie this is driving me nuts i wrote a simple unit file for our app. Running the command manually works perfectly. Running it as myapp.service:

    systemctl status shows status=200/CHDIR and that's it. No useful message. I've reloaded teh daemon a dozen times.

    Ive compared teh command in ExecStart with what i type in my shell character by character. they look identical. the service user exists. i'm clearly missing smth about how systemd runs things, but i can't figure out what it is. what am i doing wrong??

    rage

    2
  2. wait is ExecStart an absolute path, and is the file executable with a proper shebang?

    6 0 helpful
  3. yeah so journal says Failed to locate executable and then status=200/CHDIR, so the path is wrong somehow. hope thats enough info 😅

    0 5 helpful
  4. after editing, always sudo systemctl daemon-reload and then sudo systemctl restart worker.service. systemd-analyze verify /etc/systemd/system/worker.service catches syntax mistakes. fingers crossed 🤞

    6 0 helpful
  5. yeahhh if its flapping, check Restart= and StartLimitIntervalSec=/StartLimitBurst=. After hitting teh limit, clear it with sudo systemctl reset-failed worker.service once the cause is fixed. good luck man!

    1 8 helpful

Reply to this topic

Sign in or create an account to reply.