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:
parent
c6f8800a2f
commit
357d497e55
@ -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='.'):
|
||||||
|
14
vm/scripts/restart_supervisor.sh
Normal file
14
vm/scripts/restart_supervisor.sh
Normal 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
|
@ -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",
|
||||||
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user