[Unit]
Description=Adastra Storage Appliance Management System
Documentation=https://github.com/example/storage-appliance
After=network.target zfs-import.service
Wants=network.target

[Service]
Type=simple
User=adastra
Group=adastra
WorkingDirectory=/opt/adastra-storage
ExecStart=/opt/adastra-storage/bin/adastra-storage
Restart=on-failure
RestartSec=5s
StandardOutput=journal
StandardError=journal
SyslogIdentifier=adastra-storage

# Security settings
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/opt/adastra-storage/data /opt/adastra-storage/logs

# Resource limits
LimitNOFILE=65536
LimitNPROC=4096

# Environment
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Environment="INSTALL_DIR=/opt/adastra-storage"
Environment="DATA_DIR=/opt/adastra-storage/data"

[Install]
WantedBy=multi-user.target

