Ok, this is a tricky one (I think) I need to reload php5-fpm from a php script The obvious issue is that once the reload command is executed, the current script is disturbed, I tried to delay the execution like so
(sleep 5; sudo service php5-php reload) & echo "" but this does not help, the immediate nginx response is 502 bad gateway. FYI, i'm using php's exec function
any way around this?