1

I have a task defined in Supervisor that I would like to invoke hourly from /etc/cron.hourly. I can run it manually, but not from run-parts:

$ sudo supervisorctl start my-task -- works

# . /etc/cron.hourly/my-script -- works

$ sudo run-parts --report --test /etc/cron.hourly -- lists my-script as expected

$ sudo run-parts --report /etc/cron.hourly -- fails with:

/etc/cron.hourly/my-script:
run-parts: failed to exec /etc/cron.hourly/my-script: No such file or directory
run-parts: /etc/cron.hourly/my-script exited with return code 1

The contents of /etc/cron.hourly/my-script is:

#!/bin/sh
/usr/bin/supervisorctl start my-task

I have confirmed that:

What am I missing?

lofidevops
  • 21,912

1 Answers1

1

I created my-script on Windows, so the shebang was correct, but had a Windows line ending. This will cause a cron script to fail. Recreating the script on Ubuntu (and chmodding it etc) fixed the problem.

lofidevops
  • 21,912