Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
howto:systemd [2016/12/11 09:31] – Added Ubuntu 16.04 systemd startup with enhanced options Karloch | howto:systemd [2020/01/31 12:04] – Clean-up. Provide download link to sbbs.service in CVS. Use wildcards in setcap command. digital man | ||
---|---|---|---|
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 the follow files (please correct your ExecStart path and User/Group as you need): | + | Create and edit (or download from [[http:// |
===== 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 | ||
Environment=SBBSROOT=/ | Environment=SBBSROOT=/ | ||
User=sbbs | User=sbbs | ||
Group=sbbs | Group=sbbs | ||
PermissionsStartOnly=true | PermissionsStartOnly=true | ||
- | ExecStartPre=/ | + | ExecStartPre=/ |
- | ExecStart=/ | + | ExecStart=/ |
ExecReload=/ | ExecReload=/ | ||
- | StandardInput=null | ||
- | StandardOutput=null | ||
Restart=on-failure | Restart=on-failure | ||
RestartSec=30 | RestartSec=30 | ||
| | ||
- | | + | [Install] |
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
+ | </ | ||
Some points in this config: | Some points in this config: | ||
* **After**. If you are using syslog with sbbs, so it is nice to put that requirement before systemd tries to launch sbbs. | * **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 " | ||
* **Environment**. In order to avoid having multiple files, you can embed the variables inside the service file. | * **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 | + | * **User/ |
- | * **ExecStartPre**. | + | * **PermissionsStartOnly**. This one tells systemd to execute ExecStartPre |
- | * **ExecStart**. It's actually more useful to run sbbs without daemonize under systemd, in contrast to the SysV way, so the " | + | * **ExecStartPre**. |
- | * **StandardInput/ | + | * **ExecStart**. If you don't want to get syslog entries duplicated you will have to run SBBS in daemonized mode, so the "d" |
* **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. | ||
Installation instructions: | Installation instructions: | ||
- | - Put this file in / | + | -Modify the environment variables to match your SBBS setup |
- | - Run " | + | -Modify User and Group. If you run this as root you don't need the ExecStartPre line. |
- | - sbbs will be executed at startup and systemd will follow his execution health. | + | -Modify the ExecStart and ExecStartPre paths to match your Synchronet setup. |
+ | -Place | ||
+ | -Enable the service with " | ||
+ | -To run the service without restarting " | ||
Running //systemctl status sbbs// will show: | Running //systemctl status sbbs// will show: | ||
● sbbs.service - Synchronet BBS service | ● sbbs.service - Synchronet BBS service | ||
- | Loaded: loaded (/ | + | |
- | | + | Active: active (running) since Thu 2016-12-15 20:20:43 CET; 16s ago |
- | | + | Docs: man:sbbs |
- | Main PID: 1226 (sbbs) | + | Process: 12364 ExecStart=/ |
- | Tasks: | + | |
- | | + | |
- | CPU: 1min 38.596s | + | |
- | | + | Memory: |
- | | + | |
+ | CGroup: / | ||
+ | └─12374 / | ||
| | ||
- | Dec 11 18:23:25 HISPAMSX sbbs[1226]: term Node 1 Telnet | + | Dec 15 20:23:25 HISPAMSX sbbs[1226]: term Node 1 Telnet |
- | Dec 11 18:23:25 HISPAMSX sbbs[1226]: 12/11 18:23:25 term Node 1 Telnet | + | Dec 15 20:23:31 HISPAMSX sbbs[1226]: term Node 1 Terminal not detected, reducing inactivity hang-up timeout to 75 seconds |
- | Dec 11 18:23:31 HISPAMSX sbbs[1226]: term Node 1 Terminal not detected, reducing inactivity hang-up timeout to 75 seconds | + | Dec 15 20:23:36 HISPAMSX sbbs[1226]: term Node 1 Unknown User ' |
- | Dec 11 18:23:31 HISPAMSX sbbs[1226]: 12/11 18:23:31 term Node 1 Terminal not detected, reducing inactivity hang-up timeout to 75 seconds | + | Dec 15 20:24:02 HISPAMSX sbbs[1226]: term Node 1 disconnected |
- | Dec 11 18:23:36 HISPAMSX sbbs[1226]: term Node 1 Unknown User ' | + | Dec 11 20:24:03 HISPAMSX sbbs[1226]: term Node 1 thread terminated (0 node threads remain, 71 clients served) |
- | Dec 11 18:23:36 HISPAMSX sbbs[1226]: 12/11 18:23:36 term Node 1 Unknown User ' | + | |
- | Dec 11 18:24:02 HISPAMSX sbbs[1226]: term Node 1 disconnected | + | ===== Monitoring with Byobu (Tmux backend) ===== |
- | Dec 11 18:24:02 HISPAMSX sbbs[1226]: 12/11 18:24:02 term Node 1 disconnected | + | 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. |
- | Dec 11 18:24:03 HISPAMSX sbbs[1226]: term Node 1 thread terminated (0 node threads remain, 71 clients served) | + | |
- | | + | Create the file '' |
+ | |||
+ | | ||
+ | new-window -n sbbs tail -n 50 -f / | ||
+ | split-window -h / | ||
+ | split-window -t 1 -v / | ||
+ | set-option mouse on | ||
+ | |||
+ | And then run: '' | ||
+ | |||
+ | 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: | ||
+ | |||
+ | {{:monitor: | ||
+ | |||
+ | 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 & CentOS 7 ===== | ||
- | ===== Debian ===== | ||
/ | / | ||
SBBSCTRL=/ | SBBSCTRL=/ | ||
Line 139: | Line 170: | ||
{{: | {{: | ||
+ | |||
+ | ===== 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:// | |
- | {{tag>}} | + | {{tag>linux systemd}} |