ahdinosaur / ssb-pub

easily host your own Secure ScuttleButt (SSB) pub in a docker container
http://butt.nz/
GNU Affero General Public License v3.0
158 stars 25 forks source link

fix hourly cron scripts #14

Closed ahdinosaur closed 5 years ago

ahdinosaur commented 5 years ago

https://github.com/ahdinosaur/ssb-pub/issues/12#issuecomment-431627368

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

chur @mixmix

mixmix commented 5 years ago

hmm, I think I deployed this @ahdinosaur (as in manually installed those cron things) and I'm still seeing my server go down. I guess there's a chance that I could have caught it before the hourly cron started it up again

On Oct 21 2018, at 1:07 pm, Mikey notifications@github.com wrote:

Merged #14 (https://github.com/ahdinosaur/ssb-pub/pull/14) into master.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/ahdinosaur/ssb-pub/pull/14#event-1916436652), or mute the thread (https://github.com/notifications/unsubscribe-auth/ACitnrrS4Y37QNjtoH7zVHo0zFj6QT8Bks5um7q8gaJpZM4XyMpi).