2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

restart supervisor on boot

This is being added to restart supervisor inside the virtual machine on
boot, since the command 'bench update' breaks on boot, since the
supervisor is not active. This is a bug in debian, which has been
propogated to ubuntu, and this piece of code can be removed when the bug
is fixed.
This commit is contained in:
Ameya Shenoy 2018-03-22 15:21:50 +05:30
parent c6f8800a2f
commit 357d497e55
No known key found for this signature in database
GPG Key ID: 735490161CD5C91E
4 changed files with 22 additions and 2 deletions

View File

@ -407,8 +407,6 @@ def restart_supervisor_processes(bench_path='.', web_workers=False):
else: else:
group = 'frappe:' group = 'frappe:'
if find_executable('systemctl'):
exec_cmd('sudo systemctl restart supervisor.service && sleep 1')
exec_cmd('sudo supervisorctl restart {group}'.format(group=group), cwd=bench_path) exec_cmd('sudo supervisorctl restart {group}'.format(group=group), cwd=bench_path)
def set_default_site(site, bench_path='.'): def set_default_site(site, bench_path='.'):

View File

@ -0,0 +1,14 @@
#! /bin/bash
# Write out current crontab
crontab -l > current_cron
# Echo new cron into cron file
echo "@reboot sleep 20 && systemctl restart supervisor" >> current_cron
# Install new cron file
crontab current_cron
# Delete the temporary cron file
rm current_cron

View File

@ -80,6 +80,10 @@
}, { }, {
"type": "shell", "type": "shell",
"script": "scripts/set_message.sh" "script": "scripts/set_message.sh"
}, {
"type": "shell",
"execute_command": "echo 'frappe' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/restart_supervisor.sh"
}], }],
"post-processors": [{ "post-processors": [{
"type": "checksum", "type": "checksum",

View File

@ -80,6 +80,10 @@
}, { }, {
"type": "shell", "type": "shell",
"script": "scripts/set_message.sh" "script": "scripts/set_message.sh"
}, {
"type": "shell",
"execute_command": "echo 'frappe' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/restart_supervisor.sh"
}], }],
"post-processors": [{ "post-processors": [{
"type": "checksum", "type": "checksum",