From 55b7e5b6cd29e12c66377d3a91e405a6b8263dcb Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Fri, 9 Dec 2022 19:08:29 -0800 Subject: [PATCH] Overhaul the systemd uint configuration file We have no sbbs man page (that I know of). The SBBSROOT env var isn't used anywhere. NotifyAccess is required for the (new to v3.20) systemd integration support We can just use the AmbientCapbilities to set the bind capability now Set the open file limit to something huge (10000 files should be enough) Update the instructions/comments. --- install/systemd/sbbs.service | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/install/systemd/sbbs.service b/install/systemd/sbbs.service index ebd8df0c77..d438fd52ff 100644 --- a/install/systemd/sbbs.service +++ b/install/systemd/sbbs.service @@ -1,31 +1,30 @@ -# Synchronet BBS startup file - Setup instructions +# Synchronet BBS systemd 'unit configuration' file # -# 1. Modify the environment variables to match your SBBS setup -# 2. Modify User and Group. If you run this as root you don't need -# the ExecStartPre line. -# 3. Modify the ExecStart and ExecStartPre paths to match your -# Synchronet setup. -# 4. Place this file in the correct location. For Ubuntu 16.04 -# you should place it in /lib/systemd/system -# 5. Enable the service with "systemctl enable sbbs" -# 6. To run the service without restarting "systemctl start sbbs" +# 1. Copy this file to the correct directory +# e.g. for Debian/Ubuntu Linux, that would be: /lib/systemd/system +# 2. If necessary, modify the SBBSCTRL environment variable value to match your install +# 3. If necessary, modify the User and Group values to match your install +# 4. If necessary, modify the path in the ExecStart value to match your install +# 5. Enable the BBS service by running "systemctl enable sbbs" +# 6. To run the BBS service without rebooting, run "systemctl start sbbs" [Unit] -Description=Synchronet BBS service -Documentation=man:sbbs +Description=Synchronet BBS +Documentation=http://wiki.synchro.net/ After=syslog.target network.target [Service] Type=forking -Environment=SBBSROOT=/sbbs SBBSCTRL=/sbbs/ctrl +NotifyAccess=main +Environment=SBBSCTRL=/sbbs/ctrl User=sbbs Group=sbbs -PermissionsStartOnly=true -# ExecStartPre=/sbin/setcap 'cap_net_bind_service=+ep' /sbbs/src/sbbs3/gcc.linux.*.exe.*/sbbs +AmbientCapabilities=CAP_NET_BIND_SERVICE ExecStart=/sbbs/exec/sbbs d ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure RestartSec=30 +LimitNOFILE=10000 [Install] WantedBy=multi-user.target -- GitLab