mirror of
https://github.com/D-Modem/bbs.git
synced 2026-11-28 17:38:04 -08:00
bbs.service.sample becomes bbs.service.in. make builds bbs.service from it with the path of BINDIR, and make install puts it in SYSTEMD_UNIT_DIR ($(PREFIX)/lib/systemd/system), as D-Modem does for dmodem-ari.service. The unit now waits for network-online.target and, when they are there, the database servers and dmodem-login-authd. SupplementaryGroups=asterisk is a comment, because the unit does not start on a host without that group. Running.md gives the steps after make install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRV8YPyMUdSM1QgsczH
63 lines
2.5 KiB
Plaintext
63 lines
2.5 KiB
Plaintext
# bbs.service: the BBS under systemd (docs/wiki/Running.md).
|
|
# make install puts this unit in $(PREFIX)/lib/systemd/system, a directory
|
|
# that systemd reads for /usr/local and /usr. SYSTEMD_UNIT_DIR selects a
|
|
# different one.
|
|
# Then: systemctl daemon-reload && systemctl enable --now bbs
|
|
# To change the options, the user or the groups: systemctl edit bbs
|
|
[Unit]
|
|
Description=BBS for telnet, TN3270 and modem callers
|
|
Documentation=https://github.com/D-Modem/bbs/wiki/Running
|
|
Wants=network-online.target
|
|
# the database server, when the database is not SQLite; and the auth socket
|
|
# of dmodem-login, when auth_socket is set. After= on a unit that is not
|
|
# installed does nothing
|
|
After=network-online.target postgresql.service mysql.service mariadb.service dmodem-login-authd.service
|
|
|
|
[Service]
|
|
ExecStart=@BINDIR@/bbs -config /etc/bbs/bbs.conf serve
|
|
# systemctl reload bbs: bbs.conf read again, what may change while callers
|
|
# are on put in force (the log says what waits for a restart)
|
|
ExecReload=/bin/kill -HUP $MAINPID
|
|
User=bbs
|
|
Group=bbs
|
|
# or: started as root, the BBS binds its ports and becomes [general] user
|
|
# itself (docs/wiki/Running.md): then no User= and Group= here, nor
|
|
# AmbientCapabilities, and RuntimeDirectory's directory is root's (put
|
|
# unix sockets where the user may write, or give them a socket_group)
|
|
# for [listen menu]'s socket_group = asterisk. The unit does not start if
|
|
# the group is not there, so it is a comment here: put it in a drop-in
|
|
# (systemctl edit bbs) on a host with Asterisk
|
|
#SupplementaryGroups=asterisk
|
|
# for DOS doors in Docker (README, "Doors"): the docker group is as good as
|
|
# root, so think twice; rootless Docker or Podman is the safer way
|
|
#SupplementaryGroups=asterisk docker
|
|
RuntimeDirectory=bbs
|
|
RuntimeDirectoryMode=0750
|
|
StateDirectory=bbs
|
|
StateDirectoryMode=0700
|
|
UMask=0077
|
|
Restart=on-failure
|
|
# port 23 (and finger's 79, gopher's 70) without root
|
|
#AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
NoNewPrivileges=yes
|
|
ProtectSystem=strict
|
|
# the sysop's Configuration screen (on the BBS) writes bbs.conf: let it,
|
|
# with /etc/bbs and the file the bbs user's to write. Without, it shows
|
|
# the file and says what would change, but cannot write it (bbs config, as
|
|
# root on the console, can)
|
|
#ReadWritePaths=/etc/bbs
|
|
ProtectHome=yes
|
|
PrivateTmp=yes
|
|
PrivateDevices=yes
|
|
ProtectKernelTunables=yes
|
|
ProtectKernelModules=yes
|
|
ProtectControlGroups=yes
|
|
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
|
RestrictNamespaces=yes
|
|
LockPersonality=yes
|
|
MemoryDenyWriteExecute=yes
|
|
SystemCallArchitectures=native
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|