Fix configuration for puma, and use state file to control puma