[Unit]
Description=iRedAdmin daemon service
After=network.target local-fs.target remote-fs.target

[Service]
Type=simple
ExecStartPre=-/usr/bin/mkdir /var/run/iredadmin
ExecStartPre=/usr/bin/chown iredadmin:iredadmin /var/run/iredadmin
ExecStartPre=/usr/bin/chmod 0755 /var/run/iredadmin
ExecStart=/usr/sbin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/rhel9.ini --pidfile /var/run/iredadmin/iredadmin.pid
ExecStop=/usr/sbin/uwsgi --stop /var/run/iredadmin/iredadmin.pid
ExecStopPost=/usr/bin/rm -rf /var/run/iredadmin
KillSignal=SIGTERM
TimeoutStopSec=5
PrivateTmp=true

[Install]
WantedBy=multi-user.target
