From 7a1c061b5fbc53e4a11ae9558c67ea96e2eabcf6 Mon Sep 17 00:00:00 2001 From: iRaven4522 Date: Fri, 28 Nov 2025 21:38:34 -0600 Subject: [PATCH] Add services --- services/meshcentral.openrc | 18 ++++++++++++++++++ services/meshcentral.service | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 services/meshcentral.openrc create mode 100644 services/meshcentral.service diff --git a/services/meshcentral.openrc b/services/meshcentral.openrc new file mode 100644 index 0000000..41f4c1a --- /dev/null +++ b/services/meshcentral.openrc @@ -0,0 +1,18 @@ +#!/sbin/openrc-run + +# MeshCentral Server OpenRC service, mostly used with Alpine Linux + +name="MeshCentral Server" +description="MeshCentral Server" + +depend() { + need networking +} + +export NODE_ENV="production" +directory="/opt/meshcentral" +command="/usr/bin/node /opt/meshcentral/node_modules/meshcentral" +command_background=true +pidfile="/run/meshcentral.pid" +output_log="/var/log/meshcentral.log" +error_log="/var/log/meshcentral.err" diff --git a/services/meshcentral.service b/services/meshcentral.service new file mode 100644 index 0000000..5e03a78 --- /dev/null +++ b/services/meshcentral.service @@ -0,0 +1,18 @@ +[Unit] +Description=MeshCentral Server + +[Service] +Type=simple +LimitNOFILE=1000000 +ExecStart=/usr/bin/node /home/meshsvc/meshcentral/node_modules/meshcentral +WorkingDirectory=/home/meshsvc/meshcentral +Environment=NODE_ENV=production +User=meshsvc +Group=meshsvc +Restart=always +# if mesh crashes, restart every 30 secs +RestartSec=30 +AmbientCapabilities=cap_net_bind_service + +[Install] +WantedBy=multi-user.target \ No newline at end of file