Correctly handle sudo when doing site restart