2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-24 15:38:25 +00:00

[fix] setup sudoers

This commit is contained in:
Anand Doshi 2016-03-23 23:47:34 +05:30
parent 8b5a1b7028
commit 8b76f2808b

View File

@ -195,7 +195,7 @@ def update_bench():
def setup_sudoers(user): def setup_sudoers(user):
sudoers_file = '/etc/sudoers.d/frappe' sudoers_file = '/etc/sudoers.d/frappe'
with open(sudoers_file, 'w') as f: with open(sudoers_file, 'w') as f:
f.write("{user} ALL=(ALL) NOPASSWD: {supervisorctl} restart frappe\:\n".format( f.write("{user} ALL=(ALL) NOPASSWD: {supervisorctl}\n".format(
user=user, user=user,
supervisorctl=subprocess.check_output('which supervisorctl', shell=True).strip())) supervisorctl=subprocess.check_output('which supervisorctl', shell=True).strip()))
os.chmod(sudoers_file, 0440) os.chmod(sudoers_file, 0440)