Closed ahdinosaur closed 6 years ago
Hey mikey I don't think this worked for me, I think i told you that on scuttlebutt. Would love to debug with you sometime
On Tue, 25 Sep 2018, 14:54 Mikey, notifications@github.com wrote:
Closed #12 https://github.com/ahdinosaur/ssb-pub/issues/12 via 5e2d2f6 https://github.com/ahdinosaur/ssb-pub/commit/5e2d2f672c377f1c501dff0f45eb0611a0c2a938 .
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ahdinosaur/ssb-pub/issues/12#event-1864618860, or mute the thread https://github.com/notifications/unsubscribe-auth/ACitnkmimmkKmZJvovsFCy108RGR8cFxks5ueZsBgaJpZM4WmEWL .
@mixmix yeah, it's not working for me either, i'm not sure why i thought i was working but my servers have been going down occasionally meow. keen to debug. :heart:
gosh i'm silly, it wasn't working and is a real simple fix to get it to work.
first i checked the cron service logs:
journalctl -u cron.service
the cron.hourly scripts is clearly running, a bunch of junk like:
Oct 19 06:17:01 ssb-pub CRON[15809]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Oct 19 06:17:01 ssb-pub CRON[15808]: (CRON) info (No MTA installed, discarding output)
i find a relevant stackoverflow post: https://stackoverflow.com/questions/14647447/cronjob-cron-daily-does-not-run-debian
says to try running the command the cron service is running:
run-parts --report /etc/cron.hourly
and yep, it's broken:
root@ssb-pub:~# run-parts --report /etc/cron.hourly
/etc/cron.hourly/healer:
run-parts: failed to exec /etc/cron.hourly/healer: Exec format error
run-parts: /etc/cron.hourly/healer exited with return code 1
/etc/cron.hourly/sbot:
run-parts: failed to exec /etc/cron.hourly/sbot: Exec format error
run-parts: /etc/cron.hourly/sbot exited with return code 1
i guess that it's because the scripts don't have a shebang, so i give each a wee #!/bin/sh
, and boom:
root@ssb-pub:~# run-parts --report /etc/cron.hourly
/etc/cron.hourly/healer:
healer
/etc/cron.hourly/sbot:
sbot
continuation from #10
at the moment, there is still a breaking case where the
sbot
orhealer
docker services go down (despite the docker config to keep them always running unless stopped).i also notice that
docker start sbot
is idempotent, meaning ifsbot
is already running it won't change anything, but ifsbot
is not running it will start it.so, we should add to the documentation a section about adding two cron jobs. on debian, we only need to run:
/cc @mixmix @soapdog