ReferenceEnterpriseRun as a serviceEnterprise

Run the Core as a service

Start a Synnax Core when the computer boots, and restart it after a failure.

A Synnax Core started from a terminal stops when the terminal closes. As a service, the Core starts when the computer boots and starts again after a crash.

Run the Core as a service

  1. Install the Core at /usr/local/bin/synnax. See Set up Synnax Enterprise.

  2. Install the service with the flags for the Core:

    sudo synnax service install --listen=synnax.example.com:9090 --auto-cert \
      --license-file=/etc/synnax/license.lic

    Change --listen to the name that clients use to reach the Core. For a different certificate, see Set up TLS.

  3. Get the license key for the computer from the portal. Put the .lic file at /etc/synnax/license.lic, readable by the synnax user:

    sudo cp synnax.lic /etc/synnax/license.lic
    sudo chown root:synnax /etc/synnax/license.lic
    sudo chmod 640 /etc/synnax/license.lic
  4. Start the service:

    sudo synnax service start
  5. Check that the Core started:

    journalctl -u synnax -f -a

    Wait for Synnax is running and available at.

The install creates the synnax system user, which runs the Core, and the systemd unit /etc/systemd/system/synnax.service. It writes the flags to /etc/synnax/config.yaml, which only root and the synnax user can read. The Core keeps its data in /var/lib/synnax/data, its certificates in /var/lib/synnax/certs, and its log in /var/lib/synnax/logs/synnax.log. The service starts when the computer boots, unless you install it with --auto-start=false. When the Core stops, systemd starts it again after 5 seconds, except after an error that only you can fix, such as a config value that is not valid. Then systemctl status synnax shows the service as failed. The unit lets the Core keep many channel files open, and lets Arc automations on the embedded Driver run on a real-time thread.

To change a flag, edit config.yaml, then run sudo synnax service stop and sudo synnax service start. For EtherCAT devices, run sudo systemctl edit synnax and add these lines:

[Service]
AmbientCapabilities=CAP_NET_RAW

A unit that you wrote yourself also works with synnax update, if its name is synnax.

On macOS, use Synnax Desktop, which starts the Core with the app.

Monitor the Core

  • Health check -> send POST /api/v1/connectivity/check with an empty JSON body. It needs no login or license, and returns 200 while the Core runs:

    curl -s -X POST https://synnax.example.com:9090/api/v1/connectivity/check \
      -H "Content-Type: application/json" -d '{}'

    The response has the Core version, its clock time, and its license state. It does not check storage.

  • Disk space -> the Core does not check free space. When the data disk is full, the Core can stop, and the service restarts it again and again. Alert well before the disk fills.

  • Logs -> the Core writes logs to its output and to the file set by --log-file-path. The file rotates at 50 MB and keeps 5 old files for 30 days. To change these values, see the CLI reference.

Do not start a Core in production with --debug. It serves profiling routes to every network with no login.