Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howto:systemd [2018/01/14 13:06] – [See Also] digital man | 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://gitlab.synchro.net/main/sbbs/-/ |
- | + | | |
- | ===== Ubuntu 16.04+ ===== | + | |
- | /lib/systemd/system/ | + | |
- | [Unit] | + | |
- | Description=Synchronet BBS service | + | |
- | Documentation=man:sbbs | + | |
- | | + | |
| | ||
- | | + | Read [[https://gitlab.synchro.net/main/sbbs/-/raw/master/install/systemd/sbbs.service|this file]] for the current instructions |
- | Type=forking | + | |
- | Environment=SBBSROOT=/sbbs SBBSCTRL=/sbbs/ctrl | + | |
- | User=sbbs | + | |
- | Group=sbbs | + | |
- | PermissionsStartOnly=true | + | |
- | ExecStartPre=/ | + | |
- | ExecStart=/sbbs/exec/sbbs d | + | |
- | ExecReload=/ | + | |
- | Restart=on-failure | + | |
- | RestartSec=30 | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=multi-user.target | + | |
- | Some points in this config: | + | |
- | | + | - Enable |
- | * **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 " | + | - To run the BBS service without rebooting, run: '' |
- | * **Environment**. In order to avoid having multiple files, you can embed the variables inside the service file. | + | |
- | * **PermissionsStartOnly**. This one tells systemd | + | |
- | * **ExecStartPre**. For some weird reason, capabilities are frequently lost from the sbbs executable. It is possible to mitigate the effect | + | |
- | * **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: | + | Any necessary edits should be made using ''sudo systemctl edit sbbs'', |
- | -Modify the environment variables to match your SBBS setup | + | /etc/ |
- | -Modify User and Group. If you run this as root you don't need the ExecStartPre line. | + | This will allow you to integrate any future upstream changes to the '' |
- | | + | |
- | -Place this file in the correct location. For Ubuntu 16.04 you should place it in /lib/ | + | |
- | | + | |
- | -To run the service without | + | |
- | Running //systemctl status | + | After editing the '' |
+ | sudo systemctl daemon-reload | ||
- | ● sbbs.service - Synchronet BBS service | + | ==== Recommended Tweaks to the Service Section ==== |
- | Loaded: loaded (/ | + | To allow core file generation |
- | Active: active (running) since Thu 2016-12-15 20:20:43 CET; 16s ago | + | |
- | Docs: man:sbbs | + | |
- | | + | |
- | | + | |
- | Main PID: 12374 (sbbs) | + | |
- | | + | |
- | Memory: 30.1M | + | |
- | CPU: 223ms | + | |
- | CGroup: / | + | |
- | └─12374 / | + | |
- | + | ||
- | Dec 15 20:23:25 HISPAMSX sbbs[1226]: term Node 1 Telnet | + | |
- | Dec 15 20:23:31 HISPAMSX sbbs[1226]: term Node 1 Terminal not detected, reducing inactivity hang-up timeout | + | |
- | Dec 15 20:23:36 HISPAMSX sbbs[1226]: term Node 1 Unknown User 'Enable' | + | |
- | Dec 15 20:24:02 HISPAMSX sbbs[1226]: term Node 1 disconnected | + | |
- | Dec 11 20:24:03 HISPAMSX sbbs[1226]: term Node 1 thread terminated (0 node threads remain, 71 clients served) | + | |
+ | <file sbbs.service> | ||
+ | LimitCORE=infinity | ||
+ | </ | ||
- | ===== Debian & CentOS 7 ===== | + | ==== Where is My Service File? ==== |
- | / | + | If you are already running Synchronet from systemd but can't remember where the config file is, the following commands will help. |
- | SBBSCTRL=/ | + | |
- | / | + | systemctl show -p FragmentPath |
- | | + | |
- | | + | |
- | | + | ===== Control ===== |
- | | + | |
+ | To start the Synchronet | ||
+ | | ||
+ | |||
+ | To restart (stop and then start) the Synchronet service | ||
+ | | ||
| | ||
- | [Service] | + | To stop the Synchronet service |
- | | + | |
- | EnvironmentFile=-/ | + | |
- | ExecStart=/ | + | |
- | ExecReload=/ | + | |
- | User=root | + | |
- | Group=root | + | |
| | ||
- | [Install] | + | ===== Monitor ===== |
- | WantedBy=multi-user.target | + | |
+ | 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 | ||
- | Finally, | + | ==== 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. | ||
- | Test your setup: | + | Create the file '' |
- | | + | |
- | | + | |
- | | + | split-window |
- | 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. | + | |
+ | And then run: '' | ||
- | ===== Debian (alternative using tmux) ===== | + | If you want this to be your default environment when you log at your Synchronet server, then write the configuration to the '' |
+ | |||
+ | The following screenshot shows the result: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | If are using also **binkd** for FidoNet, this configuration will split the dashboard in 4 panes: | ||
+ | |||
+ | new-session sbbs ; | ||
+ | new-window -n sbbs tail -n 50 -f / | ||
+ | split-window -p 50 -h / | ||
+ | split-window -t 0 -p 20 -v tail -f / | ||
+ | split-window -t 1 -v / | ||
+ | set-option mouse on | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== Debian (alternative using tmux) ==== | ||
You can use [[https:// | You can use [[https:// | ||
Line 139: | 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:// | ||
{{tag> | {{tag> | ||