Maple
Docs / Using Maple

Running as a service

Maple runs as a long-lived service. On most Linux systems that means a systemd unit.

systemd

Create a user for it and the unit:

$ sudo useradd --system --home /var/lib/maple --create-home --shell /usr/sbin/nologin maple
# /etc/systemd/system/maple.service
[Unit]
Description=Maple
After=network-online.target
Wants=network-online.target

[Service]
User=maple
ExecStart=/usr/local/bin/maple worker
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5
NoNewPrivileges=true
ProtectSystem=strict
ReadWritePaths=/var/lib/maple

[Install]
WantedBy=multi-user.target
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now maple
$ journalctl -u maple -f

Maple reloads its configuration on SIGHUP, so systemctl reload maple applies changes without a restart.

Containers

Release archives include a Dockerfile. Build the image once and run it with the configuration mounted:

$ docker build -t maple:0.4.2 .
$ docker run -d --name maple --restart unless-stopped -v /etc/maple:/etc/maple:ro maple:0.4.2 worker

Upgrading

Replace the binary and restart. Within a major version the configuration stays compatible; the changelog says when anything needs your attention.