[Unit] Description=MailArchiva After=network.target RequiresMountsFor=/var/opt/mailarchiva /opt/mailarchiva /var/log/mailarchiva [Service] Environment="JAVA_OPTS=-Djava.awt.headless=true" # Lifecycle Type=forking WorkingDirectory=/opt/mailarchiva/server/ PIDFile=/opt/mailarchiva/mailarchiva.pid ExecStart=/bin/sh /opt/mailarchiva/server/startserver ExecStop=/bin/sh /opt/mailarchiva/server/stopserver SuccessExitStatus=143 TimeoutStopSec=10m Environment=RACK_ENV=production OOMScoreAdjust=-800 # Logging SyslogIdentifier=mailarchiva # Security User=root ReadWritePaths=/var/opt/mailarchiva/ ReadWritePaths=/opt/mailarchiva/ ReadWritePaths=/var/log/mailarchiva/ # Auto restart Restart=on-failure RestartSec=3 [Install] WantedBy=multi-user.target