Manage Einhorn via the Command Socket
mainEinhorn opens a UNIX socket for administrative commands. You can interact with it using the einhornsh utility.
Configuration:
- Use
-d DIRECTORYto specify where the command socket file will be created. - The command socket uses a line-oriented YAML protocol. Ensure you trust clients, as they can send arbitrary YAML messages.
Seamless Upgrades: To reload your code without downtime:
- Upgrade the worker code on disk.
- Run
einhornshand execute theupgradecommand.
Einhorn will spawn new workers and send a SIGUSR2 to old workers, which should be interpreted as a request for a graceful shutdown.
einhornsh
> upgrade