2 Systemd
oooo-ps edited this page 2025-06-28 20:59:41 +03:00

Run nexy as systemd service.

System user

  1. useradd -m nexy - create new system user with its home directory
  2. passwd nexy - provide strong password
  3. su nexy - login as nexy
  4. cd - navigate to the home folder
  5. mkdir /home/nexy/public - create location for the public fies

Service configuration

Create new file /etc/systemd/system/nexy.service with following settings:

[Unit]
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=nexy
Group=nexy
ExecStartPre=/bin/sleep 10
ExecStart=/usr/local/bin/nexy -p /home/nexy/public -b 0.0.0.0:1900
StandardOutput=file:/home/nexy/debug.log
StandardError=file:/home/nexy/error.log

[Install]
WantedBy=multi-user.target
  • replace 0.0.0.0:1900 with your address, use [300:xxxx:xxxx:xxxx::1]:1900 notation for IPv6
  • bind (-b) as many interfaces as desired
  • to disable errors output, set StandardError as null

Manage

  • sudo systemctl daemon-reload - apply new configuration
  • sudo systemctl enable nexy - autostart on system startup
  • sudo systemctl restart nexy - start the service