aptible / supercronic

Cron for containers
MIT License
1.88k stars 113 forks source link

Reaper doesn't look for supercronic in PATH #177

Open atesca09 opened 5 days ago

atesca09 commented 5 days ago

Since #172 in v0.22.3 I'm getting

time="2024-10-12T08:43:03+02:00" level=info msg="reaping dead processes"
time="2024-10-12T08:43:03+02:00" level=fatal msg="Failed to fork exec: no such file or directory"

I debugged that behavior to https://github.com/aptible/supercronic/blob/cca6b3a90abc99a024f4b437da0f1886da68ca7a/reaper.go#L34

If the current working dir is / but supercronic is installed in a directory included in PATH e.g. /usr/local/bin/supercronic the reaper still tries to execute supercronic from / which doesn't exist there.

qianlongzt commented 5 days ago

I made a fix, you can try it. @atesca09

https://github.com/aptible/supercronic/pull/178

atesca09 commented 5 days ago

Thanks for the prompt fix! I've tested the changes, and it works for me now.