Compare commits

...

55 Commits

Author SHA1 Message Date
7995cfd8fe Enable ARM64 build
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 6m56s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 13m41s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
2025-03-28 09:24:09 +11:00
42bcfcdd64 The SBBS PID file is now in SBBSCTRL 2025-03-28 09:21:59 +11:00
d5ccdfae98 Clone directly from synchro.net
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 7m32s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
2025-01-05 11:58:00 +11:00
25fe513953 Fix for startup when running under rosetta
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 7m25s
Create Docker Image / Final Docker Image Manifest (push) Successful in 11s
2024-12-23 12:52:52 +11:00
e74cdb4618 Updates for gitea
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 6m28s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
2024-12-23 12:25:27 +11:00
491a0f1be8 Update to build since there is no GNUmakefile anymore 2024-12-23 11:47:54 +11:00
ffae70dabb Updated start.sh, to allow for different PID location 2023-12-09 16:21:28 +11:00
0cf79f7354 Only use HTTP proxy if environment defined 2023-06-27 09:35:35 +10:00
Deon George
68fd0ff94e Remove NNCP and other commented out tools 2023-05-29 13:17:18 +10:00
Deon George
31f1f89ad8 Removed the force IPv4, not required since we use squid via http_proxy 2023-05-29 12:35:50 +10:00
Deon George
9937972d6a Preserve web from build 2023-05-29 11:18:19 +10:00
Deon George
6a21185f0a Update CI so we can build other archs 2023-05-24 20:45:55 +10:00
Deon George
a5457d80af sed is -i -e not -ie 2023-05-24 20:19:48 +10:00
Deon George
64c13dacb4 PID file is now var/run 2023-05-24 20:19:38 +10:00
Deon George
f6f89f6086 Removed my tags buffer patch as it has been fixed upstream #f7d2b24d 2023-05-17 09:39:44 +10:00
Deon George
1f612dd027 Put back NNCP, sbbs.pid is now in SBBSCTRL, remove cvs from build. 2023-04-14 13:26:06 +10:00
Deon George
7a32a52517 Update tags patch, remove nncp 2023-04-11 22:18:20 +10:00
Deon George
f321af3062 Force apt to use IPv4, update config to have nodes in ../nodes/ now that SBBS 3.20 uses ini files 2023-01-22 11:43:58 +11:00
Deon George
a20a9022ce Added some more supervisor config for sbbs, giving sbbs more time to start 2022-10-27 11:54:46 +11:00
Deon George
4000df716c Fix awk FS with nulls 2022-10-17 22:57:20 +11:00
Deon George
99308f701b Updated to bullseye, added nncp 2022-10-17 00:05:44 +11:00
Deon George
6be2019885 Checkout a custom branch, so git_*.h headers reflect our custom version of SBBS, but with the upstreams commit 2022-05-28 13:34:33 +10:00
Deon George
c6930db160 Add patch to reserve space for tags in message headers 2022-05-28 13:07:54 +10:00
Deon George
363a9184c0 Revert "Force build on apu runner"
No longer required, since the issue with cryptlib has been resolved

This reverts commit aceeed758bdba7caba49285ef01df1e42314416f.
2022-02-27 16:24:09 +11:00
Deon George
aceeed758b Force build on apu runner 2021-04-24 12:01:52 +10:00
Deon George
50f6e8fe0c Updates for SBBS v3.19 2021-04-05 00:05:51 +10:00
Deon George
7cb746ceb2 Moved Doorparty out into its own container - part 2 2021-03-16 21:55:21 +11:00
Deon George
57c3e5149a Moved Doorparty out into its own container 2021-03-16 20:59:44 +11:00
Deon George
4ede70a917 Remove attempts to map to a CD 2021-01-15 17:42:03 +11:00
Deon George
0d2de5c97c Move xtrn into xtrn orig 2021-01-15 08:59:35 +11:00
Deon George
564e85a1d9 Fix syntasx error in init from last commit 2021-01-14 17:46:26 +11:00
Deon George
ba0b285a8f Auto run doorparty.sh on container start 2021-01-14 17:43:48 +11:00
Deon George
e2c81af094 Doorparty setup fixes and creating users 2021-01-14 17:29:43 +11:00
Deon George
ec80048e19 Add doorparty and sshd 2021-01-14 00:45:02 +11:00
Deon George
9727eb7578 Revert "Revert patch f6ffda09 - fails to build otherwise"
This reverts commit 1f75382ada057420cb6f57dbfdfab996116551a1.

No longer required, fix implemented upstream.
2021-01-04 12:30:31 +11:00
Deon George
7055833ed3 More fixes for nodes/ initialisation 2020-11-26 21:38:01 +11:00
Deon George
196b15be0c Fix nodes/ initialisation 2020-11-23 14:17:15 +11:00
Deon George
61b025f91f Put initial main.cnf in the right place for initial builds 2020-11-23 13:32:42 +11:00
Deon George
1f75382ada Revert patch f6ffda09 - fails to build otherwise 2020-11-23 13:14:06 +11:00
Deon George
ebe72b1d8f Changed leenooks apt repository config 2020-11-23 10:39:17 +11:00
Deon George
8453f48ae4 Updated to new main.cnf where nodes are in nodes/ 2020-11-23 10:35:17 +11:00
Deon George
4e0224589b Change version to latest 2020-09-10 11:31:08 +10:00
Deon George
1059cdf82a Remove git repo after install 2020-09-10 11:30:09 +10:00
Deon George
273a605ea0 Change CVS to GIT, added PHP 2020-09-10 00:25:25 +10:00
Deon George
530d917267 Added sqlite and xml php libraries
Change to build libmozjs
2020-08-11 11:12:14 +10:00
Deon George
6a13bd0be7 Fixed daemon name checking 2020-08-02 17:52:09 +10:00
Deon George
adc38bc7d4 Updates and now enabled using daemon mode 2020-06-21 14:01:30 +10:00
Deon George
1e75b5fe05 Remove makenl, update to 3.18a 2020-05-13 22:29:53 +10:00
Deon George
90ebcf6059 Updated to buster, added php 2020-03-11 13:52:35 +11:00
Deon George
9c0765283b Added node 5 2019-10-03 17:36:37 +10:00
Deon George
6c9dfc37dc Fixes for logrotate 2019-08-15 08:58:32 +10:00
Deon George
28a1cc2aa8 Lock ZT to 1.4.0, 1.4.2 segfaults 2019-08-14 22:21:34 +10:00
Deon George
6986bc92d8 Added supervisor/logrotate and startup dirs use symlinks 2019-08-14 20:57:45 +10:00
Deon George
7ac241d5bc Removed variables in gitlab-ci 2019-07-25 21:16:08 +10:00
Deon George
3ef795079c Consilidate gitlab-ci files 2019-07-25 21:13:50 +10:00
14 changed files with 316 additions and 144 deletions

View File

@ -0,0 +1,104 @@
name: Create Docker Image
run-name: ${{ gitea.actor }} Building Docker Image 🐳
on: [push]
env:
VERSION: latest
DOCKER_HOST: tcp://127.0.0.1:2375
jobs:
build:
strategy:
matrix:
arch:
- x86_64
- arm64
# needs: [test]
name: Build Docker Image
runs-on: docker-${{ matrix.arch }}
container:
image: docker:dind
privileged: true
env:
ARCH: ${{ matrix.arch }}
VERSIONARCH: ${{ env.VERSION }}-${{ env.ARCH }}
steps:
- name: Environment Setup
run: |
# If we have a proxy use it
if [ -n "${HTTP_PROXY}" ]; then echo "HTTP PROXY [${HTTP_PROXY}]"; sed -i -e s'/https/http/' /etc/apk/repositories; fi
# Some pre-reqs
apk add git curl nodejs
# Start docker
( dockerd --host=tcp://0.0.0.0:2375 --tls=false & ) && sleep 3
## Some debugging info
# docker info && docker version
# env|sort
- name: Registry FQDN Setup
id: registry
run: |
registry=${{ github.server_url }}
echo "registry=${registry##http*://}" >> "$GITHUB_OUTPUT"
- name: Container Registry Login
uses: docker/login-action@v2
with:
registry: ${{ steps.registry.outputs.registry }}
username: ${{ gitea.actor }}
password: ${{ secrets.PKG_WRITE_TOKEN }}
- name: Code Checkout
uses: actions/checkout@v4
- name: Record version and Delete Unnecessary files
run: |
echo ${GITHUB_SHA::8} > VERSION
rm -rf .git* tests/ storage/app/test/
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
push: true
tags: "${{ steps.registry.outputs.registry }}/${{ env.GITHUB_REPOSITORY }}:${{ env.VERSIONARCH }}"
manifest:
name: Final Docker Image Manifest
runs-on: docker-x86_64
container:
image: docker:dind
privileged: true
needs: [build]
steps:
- name: Environment Setup
run: |
# If we have a proxy use it
if [ -n "${HTTP_PROXY}" ]; then echo "HTTP PROXY [${HTTP_PROXY}]"; sed -i -e s'/https/http/' /etc/apk/repositories; fi
# Some pre-reqs
apk add git curl nodejs
# Start docker
( dockerd --host=tcp://0.0.0.0:2375 --tls=false & ) && sleep 3
- name: Registry FQDN Setup
id: registry
run: |
registry=${{ github.server_url }}
echo "registry=${registry##http*://}" >> "$GITHUB_OUTPUT"
- name: Container Registry Login
uses: docker/login-action@v2
with:
registry: ${{ steps.registry.outputs.registry }}
username: ${{ gitea.actor }}
password: ${{ secrets.PKG_WRITE_TOKEN }}
- name: Build Docker Manifest
run: |
docker manifest create ${{ steps.registry.outputs.registry }}/${{ env.GITHUB_REPOSITORY }}:${{ env.VERSION }} \
${{ steps.registry.outputs.registry }}/${{ env.GITHUB_REPOSITORY }}:${{ env.VERSION }}-x86_64 \
${{ steps.registry.outputs.registry }}/${{ env.GITHUB_REPOSITORY }}:${{ env.VERSION }}-arm64
docker manifest push --purge ${{ steps.registry.outputs.registry }}/${{ env.GITHUB_REPOSITORY }}:${{ env.VERSION }}

View File

@ -1,21 +0,0 @@
image: docker:latest
stages:
- build
variables:
VERSION: 3.17c-${ARCH}
CACHETAG: build-${ARCH}
DOCKER_HOST: tcp://docker:2375
services:
- docker:dind
before_script:
- docker info
- docker version
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
- ls -alR .
include: .gitlab-docker-x86_64.yml
#include: .gitlab-docker-armv7l.yml

View File

@ -1,16 +0,0 @@
armv7l:build:
variables:
ARCH: armv7l
stage: build
image: docker:latest
script:
- if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true"
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}
tags:
- docker
- armv7l
only:
- master

View File

@ -1,17 +0,0 @@
x86_64:build:
variables:
ARCH: x86_64
stage: build
image: docker:latest
script:
- if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true"
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}
tags:
- docker
- x86_64
only:
- master

View File

@ -1,66 +0,0 @@
# NAME leenooks/sbbs
# VERSION 3.17c
FROM debian:stretch-slim
# Base utilities
RUN apt-get update \
&& apt-get install -yqq curl procps less zip unzip arj unrar-free lhasa arc zoo logrotate libmozjs185-1.0 cron \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Add in Leenooks' apt repository
RUN curl -s http://apt.leenooks.net/setup.sh | sh
# Add ZeroTier
RUN echo "deb http://download.zerotier.com/debian/stretch stretch main" > /etc/apt/sources.list.d/zerotier.list
# Leenooks Utils
RUN apt-get update \
&& apt-get install -yqq --allow-unauthenticated makenl zerotier-one \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Other Utilities
RUN echo "deb http://ftp.au.debian.org/debian/ stretch contrib" > /etc/apt/sources.list.d/contrib.list
RUN apt-get update \
&& apt-get install -yqq dosemu \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Build SBBS
RUN apt-get update \
&& apt-get install -yqq build-essential libnspr4-dev libncurses5-dev libmozjs185-dev cvs wget pkgconf \
&& mkdir /opt/sbbs && cd /tmp \
&& wget http://cvs.synchro.net/cgi-bin/viewcvs.cgi/*checkout*/install/GNUmakefile \
&& make RELEASE=1 USE_DOSEMU=1 NO_X=1 JSINCLUDE=/usr/include/js JSLIB=mozjs185 SBBSDIR=/opt/sbbs install \
&& rm -rf /opt/sbbs/3rdp /opt/sbbs/src \
&& mv /opt/sbbs/ctrl /opt/sbbs/ctrl.orig \
&& mkdir /opt/sbbs/nodes.orig && mv /opt/sbbs/node[1-4] /opt/sbbs/nodes.orig \
&& ln -sf nodes/node1 /opt/sbbs/ \
&& ln -sf nodes/node2 /opt/sbbs/ \
&& ln -sf nodes/node3 /opt/sbbs/ \
&& ln -sf nodes/node4 /opt/sbbs/ \
&& find /opt/sbbs -name CVS -type d -exec rm -rf {} + \
&& apt-get -y purge build-essential libnspr4-dev libncurses5-dev libmozjs185-dev cvs wget pkgconf \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /opt/sbbs
ENV SBBSCTRL=/opt/sbbs/ctrl
ENV SBBSEXEC=/opt/sbbs/exec
ENV PATH=$PATH:${SBBSEXEC}
COPY init /sbin/init
ENTRYPOINT [ "/sbin/init" ]
CMD ["sbbs"]
VOLUME [ "/var/lib/zerotier-one" ]
VOLUME [ "/opt/sbbs/data","/opt/sbbs/ctrl","/opt/sbbs/nodes","/opt/sbbs/fido" ]
# Set the default timezone for the container
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime

72
docker/Dockerfile Normal file
View File

@ -0,0 +1,72 @@
# NAME leenooks/sbbs
# VERSION latest
FROM debian:bullseye-slim
# Base utilities
RUN apt-get update \
&& apt-get install -yqq curl supervisor procps less zip unzip arj unrar-free lhasa arc logrotate cron \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Set the default timezone for the container
RUN ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
# Other Utilities
#RUN echo "deb http://deb.debian.org/debian stretch main contrib" > /etc/apt/sources.list.d/contrib.list
#RUN apt-get update \
# && apt-get install -yqq dosemu \
# && sed -ie 's#^lredir \(.*\)/media/cdrom#rem &#' /etc/dosemu/freedos/autoexec.bat \
# && apt-get -y autoremove \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Build SBBS
RUN apt-get update \
&& apt-get install -yqq git build-essential autoconf2.13 libnspr4-dev libncurses5-dev libncursesw5-dev libarchive-dev wget python2.7 pkgconf libcap2-bin sudo libarchive13 libnspr4 \
&& mkdir /opt/sbbs && cd /tmp \
&& wget https://gitlab.synchro.net/main/sbbs/-/raw/master/install/install-sbbs.mk \
&& git clone https://gitlab.synchro.net/main/sbbs.git /opt/sbbs/repo \
&& cd /tmp \
&& make -f install-sbbs.mk RELEASE=1 NO_X=1 SBBSDIR=/opt/sbbs \
&& rm -rf /opt/sbbs/3rdp /opt/sbbs/src \
&& mv /opt/sbbs/ctrl /opt/sbbs/ctrl.orig \
&& mv /opt/sbbs/text /opt/sbbs/text.orig \
&& mv /opt/sbbs/xtrn /opt/sbbs/xtrn.orig \
&& mv /opt/sbbs/web /opt/sbbs/web.orig \
&& mkdir /opt/sbbs/nodes.orig && mv /opt/sbbs/node[1-5] /opt/sbbs/nodes.orig \
&& find /opt/sbbs -name CVS -type d -exec rm -rf {} + \
&& SUDO_FORCE_REMOVE=yes apt-get -y purge git build-essential autoconf2.13 libnspr4-dev libncurses5-dev libarchive-dev libncursesw5-dev wget pkgconf libcap2-bin sudo \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /opt/sbbs/repo \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Add PHP
RUN apt-get update \
&& apt-get install -yqq composer php-cgi php-fpm php-gd php-sqlite3 php-xml \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /opt/sbbs
ENV SBBSCTRL=/opt/sbbs/ctrl
ENV SBBSEXEC=/opt/sbbs/exec
ENV PATH=$PATH:${SBBSEXEC}
COPY start.sh ${SBBSEXEC}/
COPY doorparty.js ${SBBSEXEC}/
COPY main.cnf /opt/sbbs/ctrl.orig/
VOLUME [ "/opt/sbbs/data","/opt/sbbs/ctrl","/opt/sbbs/fido","/opt/sbbs/mods","/opt/sbbs/text","/opt/sbbs/web" ]
COPY logrotate.d /etc/logrotate.d/
RUN chmod 644 /etc/logrotate.d/*
COPY supervisord.d /etc/supervisor/conf.d/
COPY docker/init-docker /sbin/init-docker
ENTRYPOINT [ "/sbin/init-docker" ]
# Our ndoes are in ../nodes/node[0-9]
RUN sed -i -e 's#=../node\([0-9]\+\)/#=../nodes/node\1/#' /opt/sbbs/ctrl.orig/main.ini

43
docker/init-docker Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
set -e
NAME="Synchronet BBS"
export PATH=$PATH:${SBBSEXEC}
if [ ! -e "${SBBSCTRL}/sbbs.ini" ]; then
echo "* Installing SBBS ctrl files into ${SBBSCTRL}"
cp -Ras ${SBBSCTRL}.orig/* ${SBBSCTRL}
fi
if [ ! -d "${SBBSCTRL}/../nodes/node1" ]; then
[ ! -d "${SBBSCTRL}/../nodes" ] && mkdir ${SBBSCTRL}/../nodes
echo "* Installing SBBS nodes files into ${SBBSCTRL}/../nodes"
cp -Ra ${SBBSCTRL}/../nodes.orig/* ${SBBSCTRL}/../nodes/
fi
if [ ! -e "${SBBSCTRL}/../text/answer.msg" ]; then
echo "* Installing SBBS text files into ${SBBSCTRL}/../text"
cp -Ras ${SBBSCTRL}/../text.orig/* ${SBBSCTRL}/../text/
fi
if [ ! -d "${SBBSCTRL}/../xtrn" -o $((ls -1 ${SBBSCTRL}/../xtrn 2>/dev/null|wc -l)||echo 0) -eq 0 ]; then
echo "* Installing SBBS xtrn files into ${SBBSCTRL}/../xtrn"
[ ! -d ${SBBSCTRL}/../xtrn ] && mkdir ${SBBSCTRL}/../xtrn
cp -Ras ${SBBSCTRL}/../xtrn.orig/* ${SBBSCTRL}/../xtrn
fi
if [ -x /usr/sbin/zerotier-one -a -n "${ENABLE_ZT}" ]; then
echo "* Starting ZeroTier"
mkdir /dev/net && mknod /dev/net/tun -m 666 c 10 200
/usr/sbin/zerotier-one -d
fi
if [ -n "$1" ]; then
echo "* Starting [$@]"
exec "$@"
else
# Start Supervisord
echo "* Starting supervisord"
exec /usr/bin/supervisord -nc /etc/supervisor/supervisord.conf
fi

38
doorparty.js Normal file
View File

@ -0,0 +1,38 @@
load('sbbsdefs.js');
var userprops = load({}, "userprops.js");
var cfg = load({}, 'modopts.js', "doorparty") || {};
var attr = console.attributes;
function make_password() {
var c;
var p = [];
while (p.length < 8) {
c = ascii(Math.ceil(Math.random() * 58) + 32);
if (p.indexOf(c) > -1) continue;
p.push(c);
}
return p.join('');
}
function get_password() {
if (cfg.password) return cfg.password; // If a system-wide password has been set, use it
var password = userprops.get('doorparty', 'password', '');
if (password != '') return password; // If the user has a DoorParty password on file, use it
password = make_password();
userprops.set('doorparty', 'password', password); // Store a DoorParty password for this user
return password;
}
console.clear(LIGHTGRAY);
console.putmsg('Connecting to DoorParty, please wait ...');
bbs.rlogin_gate(
(cfg.tunnel_host || 'localhost') + ':' + (cfg.tunnel_port || 9999),
get_password(), // password
user.alias,
argv.length ? 'xtrn='+argv[0] : undefined
);
console.attributes = attr;
console.clear();

24
init
View File

@ -1,24 +0,0 @@
#!/bin/bash
set -e
NAME="Synchronet BBS"
export PATH=$PATH:${SBBSEXEC}
if [ ! -e "${SBBSCTRL}/sbbs.ini" ]; then
echo "* Installing SBBS ctrl files into ${SBBSCTRL}"
cp -a ${SBBSCTRL}.orig/* ${SBBSCTRL}
fi
if [ ! -d "${SBBSCTRL}/../nodes/node1" ]; then
echo "* Installing SBBS nodes files into ${SBBSCTRL}/../nodes"
cp -Ra ${SBBSCTRL}/../nodes.orig/* ${SBBSCTRL}/../nodes/
fi
if [ -x /usr/sbin/zerotier-one -a -n "${ENABLE_ZT}" ]; then
echo "* Starting ZeroTier"
mkdir /dev/net && mknod /dev/net/tun -m 666 c 10 200
/usr/sbin/zerotier-one -d
fi
exec "$@"

12
logrotate.d/sbbsecho Normal file
View File

@ -0,0 +1,12 @@
/opt/sbbs/data/*.log {
daily
compress
rotate 31
dateext
olddir /opt/sbbs/data/logs/old
missingok
createolddir 775 root root
notifempty
copytruncate
dateyesterday
}

BIN
main.cnf Normal file

Binary file not shown.

38
start.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
export SBBSCTRL=/opt/sbbs/ctrl
export PIDDIR=${SBBSCTRL:-/var/run}
PIDFILE=${PIDDIR}/sbbs.pid
# Proxy signals
function kill_app(){
kill $(cat ${PIDFILE})
exit 0 # exit okay
}
trap "kill_app" SIGINT SIGTERM
sbbs -d
sleep 5
SBBS_PID=$(cat ${PIDFILE})
echo "* SBBS PID [${SBBS_PID}]"
if [ -n ${SBBS_PID} ]; then
while [ -d /proc/${SBBS_PID} ]; do
NAME=$(basename $(cat /proc/${SBBS_PID}/cmdline |awk 'BEGIN { FS = "\0" } ;{print $(NF-2)}'))
#echo "* SBBS NAME [${NAME}]"
if [ "${NAME}" != "sbbs" -a "${NAME}" != "/mnt/lima-rosetta/rosetta" ]; then
echo "! Name not matching? [${NAME}]"
break;
fi
sleep 15
done
echo "? SBBS stopped"
else
echo "? NO SBBS PID?"
fi
exit 1

2
supervisord.d/cron.conf Normal file
View File

@ -0,0 +1,2 @@
[program:cron]
command=/usr/sbin/cron -f

7
supervisord.d/sbbs.conf Normal file
View File

@ -0,0 +1,7 @@
[program:sbbs]
command=/opt/sbbs/exec/start.sh
stopwaitsecs=60
startsecs=30
startretries=2
environment=SBBSCTRL="/opt/sbbs/ctrl"
directory=/opt/sbbs