moving code for solving the pid file to execute after the getopt() call