Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork also when running in foreground #1401

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
nipapd: Fork also when running in foreground
Since forever nipapd have avoided to fork multiple processes when
running in forground. I think the idea was to simplify debugging etc,
never to be used in production. However, when deploying nipapd as a
Docker container the process is running is foreground by default also in
production and thus the behaviour is now changed to fork also for that
case.
garberg committed Oct 8, 2024
commit 0a4c5cfccff4e5be93e39861c56d7d78b567c40d
4 changes: 2 additions & 2 deletions nipap/nipapd
Original file line number Diff line number Diff line change
@@ -329,8 +329,8 @@ if __name__ == '__main__':
except:
pass

# pre-fork if we are not running in foreground
if not cfg.getboolean('nipapd', 'foreground') and num_forks is not False:
# pre-fork unless explicitly disabled
if num_forks is not False:
# default is to fork as many processes as there are cores
tornado.process.fork_processes(num_forks)


Unchanged files with check annotations Beta

#
FROM ubuntu:jammy
MAINTAINER Kristian Larsson <kristian@spritelink.net>

Check failure on line 36 in Dockerfile.nipapd

GitHub Actions / docker

DL4000 info: MAINTAINER is deprecated
ENV DEBIAN_FRONTEND=noninteractive
# apt update, upgrade & install packages
RUN apt-get update -qy && apt-get upgrade -qy \

Check failure on line 41 in Dockerfile.nipapd

GitHub Actions / docker

DL3008 info: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 41 in Dockerfile.nipapd

GitHub Actions / docker

DL3009 info: Delete the apt-get lists after installing something
&& apt-get install --no-install-recommends -qy build-essential \
libpq-dev \
libldap-dev \
FROM ubuntu:jammy
MAINTAINER Lukas Garberg <lukas@spritelink.net>

Check failure on line 28 in Dockerfile.www

GitHub Actions / docker

DL4000 info: MAINTAINER is deprecated
ENV DEBIAN_FRONTEND=noninteractive
ENV NIPAPD_HOST=nipapd NIPAPD_PORT=1337 WWW_USERNAME=guest WWW_PASSWORD=guest
# apt update, upgrade & install packages
RUN apt-get update -qy && apt-get upgrade -qy \

Check failure on line 35 in Dockerfile.www

GitHub Actions / docker

DL3008 info: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 35 in Dockerfile.www

GitHub Actions / docker

DL3009 info: Delete the apt-get lists after installing something
&& apt-get install --no-install-recommends -qy apache2 \
build-essential \
libapache2-mod-wsgi-py3 \
COPY pynipap /pynipap
COPY nipap /nipap
COPY nipap-www /nipap-www
RUN cd /pynipap && python3 setup.py install && \

Check failure on line 65 in Dockerfile.www

GitHub Actions / docker

DL3003 info: Use WORKDIR to switch to a directory
cd /nipap && pip3 --no-input install --no-cache-dir -r requirements.txt && python3 setup.py install && \
cd /nipap-www && pip3 --no-input install --no-cache-dir -r requirements.txt && python3 setup.py install && \
cd ..