Added creation of pids directory to fix #2995, replaced deprecated nginx init.d command with service one, some more clean-up