While Daemontools (djbtools) pioneered UNIX process supervision with its minimalist design, modern sysadmins often seek alternatives that better integrate with contemporary init systems. The principal pain points include:
- Non-standard timestamp format (TAI64N) complicating log parsing
- Service directory structure diverging from /etc/init.d conventions
- Incompatibility with legacy control scripts (e.g., apachectl, nginx)
1. systemd (Built-in for Most Distros)
RedHat/CentOS and Ubuntu (since 15.04) include systemd by default. Example service unit:
[Unit] Description=Node.js App After=network.target [Service] Type=simple User=nodeuser WorkingDirectory=/opt/app ExecStart=/usr/bin/node server.js Restart=always [Install] WantedBy=multi-user.target
2. Runit (DJB-style Alternative)
Maintains DJB philosophy while offering better compatibility:
#!/bin/sh exec 2>&1 exec /usr/sbin/nginx -g "daemon off;"
Place in /etc/sv/nginx/run
then symlink to /etc/service
3. Supervisor (Python-based)
Excellent for heterogeneous environments:
[program:celery] command=/opt/venv/bin/celery -A proj worker -l INFO directory=/opt/proj user=www-data autostart=true autorestart=true stderr_logfile=/var/log/celery.err.log stdout_logfile=/var/log/celery.out.log
When transitioning from Daemontools:
- Process Tree Management: Newer tools handle child processes more gracefully
- Log Rotation: Built-in support in alternatives (vs. multilog)
- Cluster Awareness: Some modern supervisors offer distributed coordination
Tool | Init Compat | Log Rotation | Hot Reload |
---|---|---|---|
systemd | Excellent | journald | Yes |
Runit | Good | Requires svlogd | Partial |
Supervisor | Fair | Built-in | Full |
While Daemontools (djbtools) remains a robust process supervisor, many sysadmins seek alternatives due to:
- Non-standard TAI64N timestamp format complicating log integration
- Non-traditional service directory structure (/service vs /etc/init.d)
- Incompatibility with conventional init scripts like apachectl
1. Systemd (Built-in for RHEL/Debian)
The most direct replacement, using native unit files:
[Unit] Description=My Service After=network.target [Service] ExecStart=/usr/local/bin/my_daemon Restart=always User=daemon [Install] WantedBy=multi-user.target
2. Runit (Daemontools-inspired)
Better compatibility with traditional init systems:
#!/bin/sh exec 2>&1 exec /usr/sbin/my_service -f config.cfg
Store in /etc/sv/my-service/run
and symlink to /service
3. Supervisor (Python-based)
Excellent for heterogeneous environments:
[program:myapp] command=/usr/bin/python /opt/myapp/main.py user=www-data autostart=true autorestart=unexpected stderr_logfile=/var/log/myapp.err.log
When transitioning from Daemontools:
- Process Trees: New supervisors may handle child processes differently
- Log Rotation: Built-in solutions may replace multilog
- Startup Order: Modern systems often include dependency management
For containerized environments, consider:
- Docker's --restart policies
- Kubernetes liveness probes
- Tini as minimal init process
Example Kubernetes liveness probe:
livenessProbe: exec: command: - /healthcheck initialDelaySeconds: 30 periodSeconds: 10