Manual

Welcome to Live Stream Fleet Solution Manual

/etc/init.d/lsfgateway enable

/etc/init.d/lsfgateway start

/etc/init.d/lsfgateway status

tail -f /var/log/lsfgateway.log

ps | grep lsfgateway

netstat -nlp | grep lsfgateway

Configure LSF Gateway as Ubuntu Background Service

This guide walks you through setting up the Live Stream Fleet Gateway (lsfgateway) as a background system service on a Linux device running OpenWRT or FriendlyWRT that is used on NanoPi Linux server using procd. This ensures the software starts automatically at boot and runs continuously in the background.


1. Download LSFGateway ARM64 version

This example is tailored specifically for running LSFGateway on a NanoPi, although it can be utilised on any OpenWRT device by downloading and installing the appropriate binary based on the device’s architecture. Since the NanoPi employs an ARM architecture, we will download the AARCH64 binary.

To download the ARM version, execute the following command:





3. Create a Systemd Service File

Create a new service unit file for lsfgateway:



Paste the following example (customise --node_id, --account_id, and --secret_key to match your configuration):
































4. Enable and Start

Run the following commands to reload systemd, start the service, and verify it is running:




5. Check if its running and other status:

To make sure the service starts automatically after a reboot:


curl -L -o lsfgateway https://github.com/LiveStreamFleet/public/releases/latest/download/lsfgateway-linux-aarch64

chmod +x lsfgateway

mv /lsfgateway /usr/bin/lsfgateway

chmod 755 /usr/bin/lsfgateway

sudo nano /etc/init.d/lsfgateway

chmod +x /etc/init.d/lsfgateway

#!/bin/sh /etc/rc.common

# /etc/init.d/lsfgateway

# (c) 2025 SOFTSIDE TECH PTY. LTD.


. /lib/functions.sh

. /lib/functions/procd.sh


START=50

STOP=50

USE_PROCD=1


SERVICE_NAME=lsfgateway

SERVICE_BIN=/usr/bin/lsfgateway

SERVICE_ARGS="--node_id YOUR_NODE_ID --account_id YOUR_ACCOUNT_ID --secret_key YOUR_SECRET_KEY"

PIDFILE=/var/run/${SERVICE_NAME}.pid

LOGFILE=/var/log/${SERVICE_NAME}.log


start_service() {

    # If already running, skip

    [ -f "$PIDFILE" ] && kill -0 "$(cat "$PIDFILE")" 2>/dev/null && {

        echo "$SERVICE_NAME already running (pid $(cat "$PIDFILE"))"

        return 0

    }


    procd_open_instance "$SERVICE_NAME"

    procd_set_param command /bin/sh -c "sleep 3; exec $SERVICE_BIN $SERVICE_ARGS >> \"$LOGFILE\" 2>&1"

    procd_set_param respawn

    procd_set_param pidfile "$PIDFILE"

    procd_close_instance

}


stop_service() {

    if [ -f "$PIDFILE" ]; then

        pid=$(cat "$PIDFILE")

        echo "Stopping $SERVICE_NAME (pid $pid)…"

        kill "$pid" && rm -f "$PIDFILE"

    else

        echo "$SERVICE_NAME not running"

    fi

}


restart_service() {

    stop_service

    sleep 1

    start_service

}


status_service() {

    if [ -f "$PIDFILE" ] && kill -0 "$(cat "$PIDFILE")" 2>/dev/null; then

        echo "$SERVICE_NAME is running (pid $(cat "$PIDFILE"))"

        return 0

    else

        echo "$SERVICE_NAME is not running"

        return 1

    fi

}


© 2025 SOFTSIDE TECH PTY. LTD.