User Tools

Site Tools


packet:xrouter-service

Differences

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

Link to this comparison view

Next revision
Previous revision
packet:xrouter-service [2025/01/21 23:29] – created ei9iubpacket:xrouter-service [2025/10/21 10:56] (current) g7taj
Line 1: Line 1:
 +====== XRouter running as a systemd service ======
 +
 +
 As XRouter is distributed as a loose binary, a little work is needed to get it set up as a service. As XRouter is distributed as a loose binary, a little work is needed to get it set up as a service.
  
Line 34: Line 37:
 XRouter uses a file called ACCESS.SYS in it's working directory to determine what rules are in place for accessing the instance - if it is present. XRouter uses a file called ACCESS.SYS in it's working directory to determine what rules are in place for accessing the instance - if it is present.
  
-If you need to access the instance from another network, you will create the file and enter the network addresses and CIDR masks that you want to permit.+If you need to access the instance from another network, you will need to create the file and enter the network addresses and CIDR masks that you wish to permit.
  
 e.g. e.g.
Line 55: Line 58:
 More information on ACCESS.SYS config can be found on the [[https://ohiopacket.org/xrpi/docs/access.sys.htm|Ohio Packet documentation pages]]. More information on ACCESS.SYS config can be found on the [[https://ohiopacket.org/xrpi/docs/access.sys.htm|Ohio Packet documentation pages]].
  
 +Working example:
 +
 +<code>
 +# cat /etc/systemd/system/xrouter.service
 +[Unit]
 +StartLimitIntervalSec=5
 +Description=XRpi service
 +After=network.target
 +StartLimitIntervalSec=0
 +
 +[Service]
 +Type=forking
 +Restart=always
 +RestartSec=5
 +User=xr
 +WorkingDirectory=/home/xr
 +ExecStart=/home/xr/xrlin64 -d
 +
 +[Install]
 +WantedBy=multi-user.target
 +</code>
 +
 +
 +
 +====== G7TAJ way of retaining console access ======
 +
 +
 +I do it like this
 +
 +Create a user xrpi
 +Make sure the xrpi files are read/writeable by this user.
 +I change the owner to them and group to pi.
 +
 +<code>chown -R xrpi:pi /home/pi/xpri</code>
 +
 +
 +create a file :
 +<code>/etc/systemd/system/xrpi.service</code>
 +
 +<code>
 +[Unit]
 +StartLimitIntervalSec=5
 +Description=XRpi service
 +After=network.target
 +StartLimitIntervalSec=0
 +
 +[Service]
 +Type=forking
 +Restart=always
 +RestartSec=5
 +User=pi
 +ExecStart=/usr/bin/tmux new-session -s XRpi -d '/usr/bin/sudo -su xrpi /home/pi/xrpi/start-xrpi.sh'
 +
 +[Install]
 +WantedBy=multi-user.target
 +</code>
 +
 +create the start-xrpi.sh script called above
 +<code>
 +#!/bin/bash
 +cd /home/pi/xrpi
 +./xrpi
 +</code>
 +
 +enable the service
 +<code>systemctl enable xrpi.service</code>
 +
 +
 +start it
 +<code>systemctl start xrpi.service</code>
 +
 +
 +Then, to get to xrpi, just do a <code>tmux a</code>
 +
 +To get out, <code>ctrl-b d</code>
packet/xrouter-service.1737502187.txt.gz · Last modified: by ei9iub