mackerelio/mackerel-agent — pull request #18 by hakobe (2014-07-04 05:47:21+00:00)
Title: Shares the code to exit the agent to prevent exiting without pidfile cleaning

Mackerel-agent sometime exit without cleaning pidfile. This pull-request fix the problem by replacing the os.Exit statement to the exit function with pidfile cleaning.