add signal handler
Merge pull request #1 from sgxiang/dev

add signal handler