#!/bin/sh set -e # Create the anchorage system user and group if missing. getent group anchorage >/dev/null 2>&1 || groupadd --system anchorage getent passwd anchorage >/dev/null 2>&1 || useradd --system --no-create-home --shell /usr/sbin/nologin -g anchorage anchorage # Directories the service needs. nfpm also creates these, but repeating # here covers the case where the operator wiped /var/lib/anchorage # between installs. mkdir -p /etc/anchorage \ /var/lib/anchorage \ /var/lib/anchorage/nats \ /var/log/anchorage chown -R anchorage:anchorage /etc/anchorage /var/lib/anchorage /var/log/anchorage chmod 0750 /var/lib/anchorage /var/lib/anchorage/nats /var/log/anchorage