[minor] refactor agent install script in Makefile, use stat socket to get agent pid
[minor/bug] init mixup
[medium] fixes to the agent upgrade protocol to support initialization by service