[Unit]
Description=FerretDB: A truly Open Source MongoDB alternative, built on Postgres
After=syslog.target network.target

[Service]
Type=simple

User=mongod
Group=mongod

# Read in configuration file if it exists, otherwise proceed
EnvironmentFile=-/etc/default/ferretdb
WorkingDirectory=/var/lib/mongod

# Where to send early-startup messages from the server
# This is normally controlled by the global default set by systemd
#StandardOutput=syslog
# Start the ferretdb process
ExecStart=/usr/bin/ferretdb
KillMode=process

# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=30

# Restart the service on failure (stateless proxy, safe to restart)
Restart=on-failure

TimeoutStopSec=30
LimitNOFILE=131072
LimitNPROC=infinity
LimitCORE=infinity

# DO NOT OOM KILL FERRETDB
OOMScoreAdjust=-100

[Install]
WantedBy=multi-user.target