A service of Daily Data, Inc.
Contact Form

User Tools

Site Tools


software:rust:server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

software:rust:server [2025/09/18 01:43] – created rodolicosoftware:rust:server [2025/09/18 01:50] (current) rodolico
Line 85: Line 85:
 cert_file = "/path/to/cert.pem"  # Path to the certificate file cert_file = "/path/to/cert.pem"  # Path to the certificate file
 key_file = "/path/to/key.pem"      # Path to the private key file key_file = "/path/to/key.pem"      # Path to the private key file
 +</code>
 +
 +===== SysVInit =====
 +
 +==== Startup script ====
 +
 +This is not very good, but it works, so I'm including it. Running this requires you create the /var/log/rustdesk directory first
 +
 +<code bash startRust>
 +#! /usr/bin/env bash
 +
 +# go into correct directory so we can find the key file
 +cd /opt/rustdesk
 +
 +# start signal server
 +/opt/rustdesk/hbbs >>/var/log/rustdesk/signalserver.log 2>>/var/log/rustdesk/signalserver.error &
 +
 +# start relay server
 +/opt/rustdesk/hbbr >>/var/log/rustdesk/relayserver.log 2>>/var/log/rustdesk/relayserver.error &
 +</code>
 +
 +**Do Not Use, work in progress**
 +<code bash hbbs>
 +#!/bin/sh
 +### BEGIN INIT INFO
 +# Provides:          hbbs
 +# Required-Start:    $network
 +# Required-Stop:     $network
 +# Default-Start:     2 3 4 5
 +# Default-Stop:      0 1 6
 +# Short-Description: Rust HBBS
 +### END INIT INFO
 +
 +# Path to the executable
 +DAEMON=/opt/rustdesk/hbbs >>/var/log/rustdesk/signalserver.log 2>>/var/log/rustdesk/signalserver.error
 +DAEMON_NAME=hbbs
 +PIDFILE=/var/run/$DAEMON_NAME.pid
 +
 +start() {
 +    echo "Starting $DAEMON_NAME..."
 +    if [ -f $PIDFILE ]; then
 +        echo "$DAEMON_NAME is already running."
 +        return 1
 +    fi
 +    $DAEMON &
 +    echo $! > $PIDFILE
 +    echo "$DAEMON_NAME started."
 +}
 +
 +stop() {
 +    echo "Stopping $DAEMON_NAME..."
 +    if [ ! -f $PIDFILE ]; then
 +        echo "$DAEMON_NAME is not running."
 +        return 1
 +    fi
 +    kill $(cat $PIDFILE)
 +    rm -f $PIDFILE
 +    echo "$DAEMON_NAME stopped."
 +}
 +
 +status() {
 +    if [ -f $PIDFILE ]; then
 +        echo "$DAEMON_NAME is running."
 +    else
 +        echo "$DAEMON_NAME is not running."
 +    fi
 +}
 +
 +case "$1" in
 +    start)
 +        start
 +        ;;
 +    stop)
 +        stop
 +        ;;
 +    status)
 +        status
 +        ;;
 +    restart)
 +        stop
 +        start
 +        ;;
 +    *)
 +        echo "Usage: $0 {start|stop|status|restart}"
 +        exit 1
 +        ;;
 +esac
 +
 +exit 0
 </code> </code>
software/rust/server.txt · Last modified: 2025/09/18 01:50 by rodolico