Error with xginx on Production

$ sudo bench setup production frappe
Restarted supervisord
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.0.0’, ‘console_scripts’, ‘bench’)()
File “/Developers/bench-repo/bench/”, line 60, in cli
File “/Library/Python/2.7/site-packages/click/”, line 716, in call
return self.main(*args, **kwargs)
File “/Library/Python/2.7/site-packages/click/”, line 696, in main
rv = self.invoke(ctx)
File “/Library/Python/2.7/site-packages/click/”, line 1060, in invoke
return processresult(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/”, line 1060, in invoke
return processresult(sub_ctx.command.invoke(sub_ctx))
File “/Library/Python/2.7/site-packages/click/”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/Library/Python/2.7/site-packages/click/”, line 534, in invoke
return callback(*args, **kwargs)
File “/Developers/bench-repo/bench/”, line 456, in setup_production
File “/Developers/bench-repo/bench/”, line 77, in setup_production
File “/Developers/bench-repo/bench/”, line 21, in restart_service
raise Exception, ‘No service manager found’
Exception: No service manager found

i know the error is can’t restart nginx, but if a type
“$ sudo nginx -s reload”
it’s works

I’m installed nginx with MacPorts and that’s why it don’t have a systemctl. How can i add a systemctl for nginx on OS X ?

Thank you guys in advance.

i solved my own issue…

$ sudo bench setup production frappe
Restarted supervisord
Starting nginx: [ OK ]

thanks any way i needed modify the file to resolve this and a few more things.

@gvargas what was the modification required? If it would benefit others, can you send a pull request?

I suppose you changed something in this line:

@anand Sure!.. First of all im on OS X… so, Nginx don’t have Service Manager i found one here:

and put this on the path “/usr/local/bin/” (to do this first remove rootless issue)
and then

and then i modify but no that line , this one:

something like this:

   exec_cmd('supervisorctl reload')
    if os.environ.get('NO_SERVICE_RESTART'):
    exec_cmd('nginxctl --restart')
    if os.environ.get('NO_SERVICE_RESTART'):

and that’s all in here, no big deal actually, but important to work

in exec_cmd(‘nginxctl --restart’)
can put something like exec_cmd(‘nginx -s reload’) and will be the same thing.