LaiRu FPM systemd service
A systemd unit can keep LaiRu FPM running and recreate runtime directories on boot.
Target
Use systemd when the host should start LaiRu FPM at boot, restart it after failures, and create /run/lairu before the socket is opened. Run workers as the same unprivileged user that owns the site files or a deliberately isolated site user.
After installing the unit, run systemctl daemon-reload, then systemctl enable --now lairu-fpm.
Examples
Working pattern
1[Service]2RuntimeDirectory=lairu3ExecStart=/usr/local/bin/lairu-fpm --config /etc/lairu/config/lairu-fpm.ini4Restart=on-failureUse this as a focused starting point and adapt it in context.
systemd unit for LaiRu FPM
1[Unit]2Description=LaiRu FastCGI process manager3After=network.target45[Service]6Type=simple7User=www-data8Group=www-data9RuntimeDirectory=lairu10ExecStart=/usr/local/bin/lairu-fpm --config /etc/lairu/config/lairu-fpm.ini11Restart=on-failure12RestartSec=21314[Install]15WantedBy=multi-user.targetInstall as `/etc/systemd/system/lairu-fpm.service`, then run `systemctl daemon-reload` and enable the service.