take pidfile path as an argument