跳转到内容
#0091
Daemon

Run a background worker without ever opening PM2

You wrote a Python worker that drains a queue. It needs to run forever, restart on crash, and survive container reboots. The old answer was PM2 if you used Node, supervisord if you read the source, or a systemd unit you'd ssh in to edit.

You POST one JSON body to /api/v1/daemon/programs/add with the command, the user, and autorestart: "true". You enable, you start. The worker is alive, monitored, log-rotated, and supervised: and you never touched a shell.

Update the command later? POST again. Check uptime? GET the status URL. Tail stderr? GET the logs URL. The daemon is supervisord battle-tested since 2004, with the CLI removed and HTTP added.

PM2 is a CLI you SSH into. Hoody Daemon is a URL anyone with a token can POST to.