How to avoid "... this will stop nginx, causing sites to go offline. Do you want to continue? [y/N]:"?

I am trying create an install script that needs no interaction at all, so I can go away and come back to a fully reinstantiated machine.

When I run …

sudo -A -H bench setup lets-encrypt --non-interactive ${PRD_ERPNEXT_SITE};

… the process is interrupted by :

Running this will stop the nginx service temporarily causing your sites to go offline
Do you want to continue? [y/N]:

I tried all these as well:

sudo -A -H bench setup lets-encrypt ${PRD_ERPNEXT_SITE} --non-interactive;
sudo -A -H bench setup lets-encrypt ${PRD_ERPNEXT_SITE} -n;
sudo -A -H bench setup lets-encrypt -n ${PRD_ERPNEXT_SITE};

Why does the flag -n or --non-interactive have no effect?

Is there a way to preseed responses?

Is there an undocumented switch?

Can I patch the code?

Am I stuck with using expect?

System consider --non-interactive flag only while generating lets-encrypt certificate and not to manage system services like nginx.

@gavindsouza can you look into this?

@MartinHBramwell let me know if this works for you

Did you see that Travis rejected your patch?

The failure doesn’t appear to be in the code you altered though.


I patched that file and can confirm that --non-interactive works as expected after that change.

1 Like