[Unit]
Description=MIDAS mhttpd
After=network-online.target
Wants=network-online.target

[Service]
Type=simple

# Run as this user/group (create them first if needed)
User=__USER__
Group=__GROUP__

# Where your daemon expects to run (optional but common)
WorkingDirectory=__MIDAS_DIR__

# Command to start your daemon
# Use an absolute path!
ExecStart=__MIDASSYS__/bin/mhttpd

# Restart behavior
Restart=always
RestartSec=5

# Logging (goes to journald; view with journalctl)
StandardOutput=journal
StandardError=journal

# Optional hardening (usually safe; remove if it breaks things)
NoNewPrivileges=true
PrivateTmp=true

# Environment variables:
Environment="MIDASSYS=__MIDASSYS__"
Environment="MIDAS_DIR=__MIDAS_DIR__"
Environment="MIDAS_EXPT_NAME=__MIDAS_EXPT_NAME__"

[Install]
WantedBy=multi-user.target
