mina-deploy / mina

Blazing fast deployer and server automation tool

Home Page:https://rubygems.org/gems/mina

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sudo systemctl restart apache2

kickbk opened this issue · comments

How would you go about restarting apache?
running command 'sudo systemctl restart apache2' hangs as it's waiting for a password.
My scripts deploys to multiple domains with multiple passwords (same SSH key though).

I do have:
set :ssh_options, "-A" and I can add set :forward_agent, true

I realize echoing the password into sudo with -S (echo <password> | sudo -S ...) would work, but it's ugly.

In case you're wondering, I need to restart Apache2 after I deploy since I have symlinks that get screwed up when a new deploy is pushed.

I'm open minded about somehow getting Apache to realize the changes without restarting it, and any other way to restart it if I must.

Help is much appreciated!

I would add those commands to use passwordless sudo:

https://askubuntu.com/a/159009