regluit-provisioning icon indicating copy to clipboard operation
regluit-provisioning copied to clipboard

setting up crontab

Open eshellman opened this issue 7 years ago • 5 comments

@jekohk , @rdhyee I'm now building new Unglue.it machines using John's playbooks, and I've begun the process of cleaning out Raymond's equivalents. (see Gluejar/regluit:more-cleanup) One thing that seems to be missing from John's scripts is a crontab setup, which in Raymond's system are used only to run emit_notices.sh once a minute and to restart the server on reboot. Have I missed anything in John's work (now moved here)?

eshellman avatar Jun 13 '18 14:06 eshellman

Also, why was emit_notices being done by cron instead of celerybeat?

eshellman avatar Jun 13 '18 14:06 eshellman

IIRC, I resorted to cron because I couldn't get celery beat to work in this case. I can't recall the details. I can dig further if you want @eshellman

rdhyee avatar Jun 18 '18 19:06 rdhyee

thanks raymond. what about the startup?

eshellman avatar Jun 18 '18 21:06 eshellman

emit notices no longer needed. remaining question is whether something is needed so reboot restarts the server

eshellman avatar Jun 21 '18 13:06 eshellman

@eshellman One thing that needed to be addressed on reboot is setting up /var/run/celery (/var/run is deleted on reboot.) That's why I had in regluit/crontab_prod.txt (and the other crontabs):

@reboot sudo mkdir /var/run/celery; sudo chown celery:celery /var/log/celery /var/run/celery; cd /opt/regluit; . /opt/regluit/ENV/bin/activate; /opt/regluit/ENV/bin/django-admin.py celeryd_multi restart w1 --settings=regluit.settings.prod; /etc/init.d/celerybeat restart;

Note the first part

@reboot sudo mkdir /var/run/celery; sudo chown celery:celery /var/log/celery /var/run/celery

I don't know whether re-creating /var/run/celery, etc is still relevant in the new setup -- but that's something to check.

rdhyee avatar Jun 21 '18 15:06 rdhyee