Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
howto:systemd [2019/04/05 14:22] – [Ubuntu 16.04+] Fixed User/Group instructions va7aqd | howto:systemd [2022/06/27 14:03] – [Ubuntu 16.04+] typo nelgin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Start Synchronet BBS from Systemd | + | ====== Start Synchronet BBS from systemd |
- | If you run modern GNU/ | + | If you run a modern GNU/ |
- | Instead | + | In this case, instead |
+ | |||
+ | Create and edit (or download from [[http:// | ||
+ | |||
+ | ===== 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. | ||
+ | |||
+ | '' | ||
+ | |||
+ | Use that service name to return the path to the config file. Example: '' | ||
- | Create and edit the follow files (please correct your ExecStart path and User/Group as you need): | ||
===== Ubuntu 16.04+ ===== | ===== Ubuntu 16.04+ ===== | ||
- | / | + | '' |
- | [Unit] | + | < |
+ | [Unit] | ||
Description=Synchronet BBS service | Description=Synchronet BBS service | ||
Documentation=man: | Documentation=man: | ||
After=syslog.target network.target | After=syslog.target network.target | ||
| | ||
- | | + | [Service] |
Type=forking | Type=forking | ||
Environment=SBBSROOT=/ | Environment=SBBSROOT=/ | ||
+ | # this stops you running out of files | ||
+ | LimitNOFILE=10000 | ||
+ | # this enables you to take a good core dump | ||
+ | LimitCORE=infinity | ||
User=sbbs | User=sbbs | ||
Group=sbbs | Group=sbbs | ||
PermissionsStartOnly=true | PermissionsStartOnly=true | ||
- | ExecStartPre=/ | ||
ExecStart=/ | ExecStart=/ | ||
ExecReload=/ | ExecReload=/ | ||
Line 26: | Line 39: | ||
RestartSec=30 | RestartSec=30 | ||
| | ||
- | | + | [Install] |
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
+ | </ | ||
Some points in this config: | Some points in this config: | ||
Line 35: | Line 49: | ||
* **User/ | * **User/ | ||
* **PermissionsStartOnly**. This one tells systemd to execute ExecStartPre as root, but ExecStart as the user and group declared in User, | * **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 " | * **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. | * **RestartSec**. It's advisable to wait some secs before attempting restarting in case of failure, just to give some time for binding release. | ||
Line 54: | Line 67: | ||
Docs: man:sbbs | Docs: man:sbbs | ||
| | ||
- | | ||
Main PID: 12374 (sbbs) | Main PID: 12374 (sbbs) | ||
| | ||
Line 68: | Line 80: | ||
Dec 11 20:24:03 HISPAMSX sbbs[1226]: term Node 1 thread terminated (0 node threads remain, 71 clients served) | Dec 11 20:24:03 HISPAMSX sbbs[1226]: term Node 1 thread terminated (0 node threads remain, 71 clients served) | ||
+ | **NOTE**:\\ | ||
+ | If you're running any kind of recent (last 2yrs+) systemd, to avoid the use of '' | ||
===== Monitoring with Byobu (Tmux backend) ===== | ===== 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 120: | Line 134: | ||
- | Finally, you must execute //systemd daemon-reload// | + | Finally, you must execute //systemd daemon-reload// |
Test your setup: | Test your setup: | ||
Line 170: | Line 184: | ||
===== Recommended Tweaks to the Service Section === | ===== Recommended Tweaks to the Service Section === | ||
- | Add these to the '' | + | Add these to the '' |
To increase the open file limit: | To increase the open file limit: | ||
- | | + | <file sbbs.service> |
+ | LimitNOFILE=10000 | ||
+ | </ | ||
To allow core file generation (for crash/ | To allow core file generation (for crash/ | ||
- | | + | <file sbbs.service> |
+ | LimitCORE=infinity | ||
+ | </ | ||
===== See Also ===== | ===== See Also ===== |