Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
howto:systemd [2016/11/21 09:52] – created ragnarok | howto:systemd [2022/05/07 20:25] – systemd shouldn't be capitalized. Added a section for people to find their existing service file. Minor formatting fix to "tweaks" section. Andre | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Start Synchornet | + | ====== Start Synchronet |
- | If you run modern GNU/Linux distribution, | + | If you run a modern GNU/Linux distribution, |
- | Instead | + | In this case, instead |
- | Debian: | + | Create and edit (or download from [[http:// |
- | Create and edit the follow file: | + | ===== Where is My Service File? ===== |
- | /etc/systemd/ | + | If you are already running Synchronet from systemd |
+ | '' | ||
+ | |||
+ | Use that service name to return the path to the config file. Example: '' | ||
+ | |||
+ | |||
+ | ===== Ubuntu 16.04+ ===== | ||
+ | ''/ | ||
+ | < | ||
+ | [Unit] | ||
+ | Description=Synchronet BBS service | ||
+ | Documentation=man: | ||
+ | After=syslog.target network.target | ||
+ | | ||
+ | [Service] | ||
+ | Type=forking | ||
+ | Environment=SBBSROOT=/ | ||
+ | User=sbbs | ||
+ | Group=sbbs | ||
+ | PermissionsStartOnly=true | ||
+ | ExecStart=/ | ||
+ | ExecReload=/ | ||
+ | Restart=on-failure | ||
+ | RestartSec=30 | ||
+ | | ||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </ | ||
+ | |||
+ | 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. | ||
+ | * **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. | ||
+ | * **User/ | ||
+ | * **PermissionsStartOnly**. This one tells systemd to execute ExecStartPre as root, but ExecStart as the user and group declared in User, | ||
+ | * **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: | ||
+ | -Modify the environment variables to match your SBBS setup | ||
+ | -Modify User and Group. If you run this as root you don't need the ExecStartPre line. | ||
+ | -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 status sbbs// will show: | ||
+ | |||
+ | ● 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: 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 to 75 seconds | ||
+ | Dec 15 20:23:36 HISPAMSX sbbs[1226]: term Node 1 Unknown User ' | ||
+ | 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) | ||
+ | |||
+ | **NOTE**:\\ | ||
+ | If you're running any kind of recent (last 2yrs+) systemd, to avoid the use of '' | ||
+ | ===== 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. | ||
+ | |||
+ | Create the file '' | ||
+ | |||
+ | new-session sbbs ; | ||
+ | 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: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | 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 ===== | ||
+ | |||
+ | / | ||
+ | SBBSCTRL=/ | ||
+ | |||
+ | / | ||
[Unit] | [Unit] | ||
Description=Synchronet BBS | Description=Synchronet BBS | ||
Documentation=man: | Documentation=man: | ||
After=network.target | After=network.target | ||
+ | | ||
[Service] | [Service] | ||
Restart=on-failure | Restart=on-failure | ||
Line 21: | Line 123: | ||
ExecStart=/ | ExecStart=/ | ||
ExecReload=/ | ExecReload=/ | ||
- | |||
User=root | User=root | ||
Group=root | Group=root | ||
+ | | ||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | |||
+ | Finally, you must execute //systemd daemon-reload// | ||
+ | |||
+ | Test your setup: | ||
+ | |||
+ | # systemctl status sbbs | ||
+ | ● sbbs.service - Synchronet BBS | ||
+ | | ||
+ | | ||
+ | Docs: man:sbbs | ||
+ | Process: 14393 ExecStart=/ | ||
+ | Main PID: 14393 (sbbs) | ||
+ | | ||
+ | | ||
+ | | ||
+ | nov 21 14:39:53 scarlet systemd[1]: Started Synchronet BBS. | ||
+ | |||
+ | |||
+ | ===== Debian (alternative using tmux) ===== | ||
+ | |||
+ | You can use [[https:// | ||
+ | |||
+ | / | ||
+ | SBBSCTRL=/ | ||
+ | |||
+ | / | ||
+ | [Unit] | ||
+ | Description=Synchronet BBS | ||
+ | Documentation=man: | ||
+ | After=network.target | ||
+ | | ||
+ | [Service] | ||
+ | Restart=on-failure | ||
+ | Type=forking | ||
+ | KillMode=none | ||
+ | EnvironmentFile=-/ | ||
+ | | ||
+ | ExecStart=/ | ||
+ | ExecStop=/ | ||
+ | | ||
+ | User=root | ||
+ | Group=root | ||
+ | | ||
[Install] | [Install] | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
+ | Using tmux, Synchronet start in a session (called sbbs), you can attach to the running console using //tmux attach -t sbbs// | ||
+ | {{: | ||
+ | |||
+ | ===== Recommended Tweaks to the Service Section === | ||
+ | Add these to the '' | ||
+ | |||
+ | To increase the open file limit: | ||
+ | <file sbbs.service> | ||
+ | LimitNOFILE=10000 | ||
+ | </ | ||
+ | |||
+ | To allow core file generation (for crash/ | ||
+ | <file sbbs.service> | ||
+ | LimitCORE=infinity | ||
+ | </ | ||
===== See Also ===== | ===== See Also ===== | ||
* [[: | * [[: | ||
- | + | * [[https:// | |
- | {{tag>}} | + | {{tag>linux systemd}} |