Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howto:systemd [2018/08/21 16:01] – Added monitoring dashboard through byobu tmux, similar to screenshot shared by ragnarok Karloch | howto:systemd [2023/04/07 12:28] (current) – Wording digital man | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Start Synchronet BBS from Systemd | + | ====== Start, Control, and Monitor |
- | If you run modern GNU/ | + | If you run a modern GNU/ |
- | Instead of use the old / | + | ===== Install ===== |
- | Create and edit the follow files (please correct your ExecStart path and User/Group as you need): | + | If you've installed Synchronet, you should already have the required [[https:// |
+ | sbbs/ | ||
+ | |||
+ | Read [[https:// | ||
- | ===== Ubuntu 16.04+ ===== | + | - Copy or symlink the '' |
- | / | + | |
- | | + | |
- | Description=Synchronet | + | |
- | | + | Any necessary edits should be made using '' |
- | | + | /etc/ |
- | + | This will allow you to integrate any future upstream changes to the '' | |
- | | + | |
- | Type=forking | + | After editing the '' |
- | Environment=SBBSROOT=/sbbs SBBSCTRL=/sbbs/ctrl | + | |
- | User=sbbs | + | |
- | | + | ==== Recommended Tweaks to the Service Section ==== |
- | | + | To allow core file generation (for crash/ |
- | ExecStartPre=/ | + | |
- | | + | <file sbbs.service> |
- | ExecReload=/ | + | LimitCORE=infinity |
- | | + | </ |
- | | + | |
- | + | ||
- | | + | |
- | | + | |
- | Some points in this config: | + | ==== Where is My Service File? ==== |
- | * **After**. If you are using syslog with sbbs, so it is nice to put that requirement before systemd tries to launch sbbs. | + | |
- | * **Type**. If you are to run SBBS in daemonized mode, the main executable will exit after the daemon is called. This could confuse systemd into thinking the process is finished. If you use "Type=forking" | + | |
- | * **Environment**. In order to avoid having multiple files, you can embed the variables inside the service file. | + | |
- | * **PermissionsStartOnly**. This one tells systemd to execute ExecStartPre as root, but ExecStart as the user and group declared in User, | + | |
- | * **ExecStartPre**. For some weird reason, capabilities are frequently lost from the sbbs executable. It is possible to mitigate the effect by running setcap just before the daemon is ran. The binding won't fail anymore using this. Please notice you can't point a symlink here, so modify the architecture directory to the right path (gcc.linux.x64.exe.release or gcc.linux.exe.release). | + | |
- | * **ExecStart**. If you don't want to get syslog entries duplicated you will have to run SBBS in daemonized mode, so the " | + | |
- | * **RestartSec**. It's advisable to wait some secs before attempting restarting in case of failure, just to give some time for binding release. | + | |
- | Installation instructions: | + | If you are already running Synchronet from systemd but can' |
- | -Modify the environment variables to match your SBBS setup | + | |
- | -Modify User and Group. | + | |
- | -Modify the ExecStart and ExecStartPre paths to match your Synchronet setup. | + | |
- | -Place this file in the correct location. For Ubuntu 16.04 you should place it in / | + | |
- | -Enable the service with " | + | |
- | -To run the service without restarting " | + | |
- | Running //systemctl | + | |
- | ● sbbs.service - Synchronet BBS service | + | |
- | | + | ===== Control |
- | Active: active (running) since Thu 2016-12-15 20:20:43 CET; 16s ago | + | |
- | Docs: man:sbbs | + | To start the Synchronet service |
- | | + | |
- | | + | |
- | | + | To restart (stop and then start) the Synchronet |
- | Tasks: 11 | + | |
- | | + | |
- | CPU: 223ms | + | |
- | CGroup: / | + | |
- | | + | |
| | ||
- | Dec 15 20:23:25 HISPAMSX sbbs[1226]: term Node 1 Telnet | + | To stop the Synchronet service |
- | | + | |
- | | + | |
- | Dec 15 20:24:02 HISPAMSX sbbs[1226]: term Node 1 disconnected | + | ===== Monitor ===== |
- | Dec 11 20:24:03 HISPAMSX sbbs[1226]: term Node 1 thread terminated (0 node threads remain, 71 clients served) | + | |
- | ===== Monitoring with Byobu (Tmux backend) | + | Display the current Synchronet service status: |
+ | systemctl status sbbs | ||
+ | |||
+ | Watch the current Synchronet service status in real-time: | ||
+ | watch systemctl status sbbs | ||
+ | |||
+ | Read/search the log output of the Synchronet service: | ||
+ | journalctl -u sbbs | ||
+ | |||
+ | Watch the log output of the Synchronet service in real-time: | ||
+ | journalctl -f -u sbbs | ||
+ | |||
+ | ==== Monitoring with Byobu (Tmux backend) ==== | ||
You can have a text mode dashboard for monitoring and configuring your BBS realtime by using Byobu with Tmux or GNU Screen backends. If you are using the Tmux backend. The following configuration splits your screen in three panes: one for SBBS log, other for UMONITOR and a last one for SCFG. Please note that this configuration assumes SBBSCTRL variable is set and that access permissions to the needed files are set for the current user. | You can have a text mode dashboard for monitoring and configuring your BBS realtime by using Byobu with Tmux or GNU Screen backends. If you are using the Tmux backend. The following configuration splits your screen in three panes: one for SBBS log, other for UMONITOR and a last one for SCFG. Please note that this configuration assumes SBBSCTRL variable is set and that access permissions to the needed files are set for the current user. | ||
Line 75: | Line 68: | ||
new-window -n sbbs tail -n 50 -f / | new-window -n sbbs tail -n 50 -f / | ||
split-window -h / | split-window -h / | ||
- | | + | |
- | split-window | + | |
set-option mouse on | set-option mouse on | ||
Line 86: | Line 78: | ||
{{: | {{: | ||
- | ===== Debian & CentOS 7 ===== | ||
- | / | + | If are using also **binkd** for FidoNet, this configuration will split the dashboard in 4 panes: |
- | SBBSCTRL=/ | + | |
- | / | + | new-session |
- | | + | |
- | Description=Synchronet BBS | + | |
- | Documentation=man: | + | |
- | After=network.target | + | split-window |
- | + | | |
- | [Service] | + | |
- | Restart=on-failure | + | |
- | EnvironmentFile=-/etc/default/sbbs | + | |
- | | + | |
- | | + | |
- | User=root | + | |
- | Group=root | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=multi-user.target | + | |
- | + | ||
- | + | ||
- | Finally, you must execute //systemd daemon-reload// for tell systemd te reload the unit file | + | |
- | + | ||
- | Test your setup: | + | |
- | + | ||
- | # systemctl status sbbs | + | |
- | ● sbbs.service | + | |
- | | + | |
- | Active: active (running) since lun 2016-11-21 14:39:53 ART; 24min ago | + | |
- | Docs: man:sbbs | + | |
- | Process: 14393 ExecStart=/sbbs/exec/sbbs nd (code=exited, | + | |
- | Main PID: 14393 (sbbs) | + | |
- | | + | |
- | | + | |
- | | + | |
- | nov 21 14:39:53 scarlet systemd[1]: Started Synchronet BBS. | + | |
+ | {{: | ||
- | ===== Debian (alternative using tmux) ===== | + | ==== Debian (alternative using tmux) ==== |
You can use [[https:// | You can use [[https:// | ||
Line 157: | Line 121: | ||
{{: | {{: | ||
- | |||
- | ===== Recommended Tweaks to the Service Section === | ||
- | Add these to the '' | ||
- | |||
- | To increase the open file limit: | ||
- | LimitNOFILE=10000 | ||
- | |||
- | To allow core file generation (for crash/ | ||
- | LimitCORE=infinity | ||
===== See Also ===== | ===== See Also ===== | ||
* [[: | * [[: | ||
+ | * [[https:// | ||
* [[https:// | * [[https:// | ||
{{tag> | {{tag> | ||