Page 2 of 3

Re: vhttpd

Posted: Thu May 13, 2021 12:07 pm
by John
I did try the container in kubernetes, and seemed to work. I did install texis in the normal location though. This was my Dockerfile:

Code: Select all

ROM centos
# Add a texis user
# Install ncurses (ltest)
# Hopefully can do away with ncurses in future
RUN useradd -ms /bin/bash texis ; yum -y install ncurses-compat-libs perl
COPY usr /usr
ENV PATH="/usr/local/morph3/bin:${PATH}"
# Fix up perms
RUN chown -R texis.texis /usr/local/morph3 ; chmod u+s /usr/local/morph3/bin/monitor ; texis -license ; rm /usr/local/morph3/bin/vhttpd ; cp /usr/local/morph3/bin/monitor /usr/local/morph3/bin/vhttpd ; chmod u+s /usr/local/morph3/bin/vhttpd

FROM centos
# Add a texis user
# Install ncurses (ltest)
# Hopefully can do away with ncurses in future
RUN useradd -ms /bin/bash texis ; yum -y install ncurses-compat-libs perl
COPY --from=0 /usr /usr
ENV PATH="/usr/local/morph3/bin:${PATH}"
# Launch script that starts monitor, and fixes up resolv.conf if it doesn't end with newline
ENTRYPOINT vhttpd -D
EXPOSE 80

Re: vhttpd

Posted: Thu May 13, 2021 12:08 pm
by mark
Did you install under /home in the working one?

Also, selinux will appear disabled inside the container. Check the host's audit log.

Re: vhttpd

Posted: Thu May 13, 2021 1:12 pm
by aitchon
Yes I installed under /home on the working one. What should I be looking for in the host audit.log? I ran the install in the Dockerfile.

Code: Select all

FROM centos:7

ARG version=7.06

ENV TEXISVERSION=$version PATH=$PATH:/home/txusr/morph3/bin

RUN adduser -u 1002 txusr
USER txusr

RUN mkdir /home/txusr/morph3
RUN mkdir /tmp/texis7-setup
RUN mkdir /home/txusr/morph3/cgi-bin

COPY texis7-setup.tar.gz /tmp/texis7-setup
COPY start_vhttpd.sh /

RUN cd /tmp/texis7-setup && \
    tar -xzf texis7-setup.tar.gz && \
    sed -i.bak 's/.*TX_DEFINSTALLDIR=.*/TX_DEFINSTALLDIR="\/home\/txusr\/morph3"/' install-non-interactive && \
    ./install-non-interactive --use-defaults --webinator-password=password && \
    rm -rf /tmp/texis7-setup

# copy vortex file here /home/txusr/morph3/texis/scripts
COPY getuniqueid /home/txusr/morph3/texis/scripts

USER root
RUN ["chmod", "+x", "/start_vhttpd.sh"]
EXPOSE 80
ENTRYPOINT "/start_vhttpd.sh"
This is start_vhttpd.sh:

Code: Select all

/home/txusr/morph3/bin/vhttpd -d /home/txusr/morph3
sleep infinity

Re: vhttpd

Posted: Thu May 13, 2021 1:18 pm
by mark
aitchon wrote: Thu May 13, 2021 1:12 pm Yes I installed under /home on the working one. What should I be looking for in the host audit.log?
Messages with "denied" or "vhttpd"

Re: vhttpd

Posted: Thu May 13, 2021 1:38 pm
by aitchon
I'm not seeing any messages related to those words. I'll try installing under /usr using your commands from your Dockerfile.

Re: vhttpd

Posted: Thu May 13, 2021 2:13 pm
by aitchon
I tried using your dockerfile, but still installing Texis in the dockerfile. Again, it worked fine in docker, but I'm seeing this in kubernetes logs:

[Thu May 13 18:10:55 2021] (1) 002 Cannot open error log /usr/local/morph3/logs/error.log: Permission denied
[Thu May 13 18:10:55 2021] (1) 002 Cannot open transfer log /usr/local/morph3/logs/transfer.log: Permission denied
[Thu May 13 18:10:55 2021] (1) 102 Cannot open error log file `/usr/local/morph3/logs/vortex.log': Permission denied
[Thu May 13 18:10:55 2021] (1) Server exiting abnormally

Re: vhttpd

Posted: Thu May 13, 2021 2:30 pm
by John
Odd, thought at least it looks like vhttpd started up, but there are still permission problems. It might make sense in your situation to have vhttpd listen on a different port (above 1024, e.g. 8080) so that it doesn't need root permissions, and then it can do everything as an ordinary user. You should still be able to configure kubernetes to have the service available on port 80 if you prefer.

Re: vhttpd

Posted: Thu May 13, 2021 3:01 pm
by aitchon
That worked. Thanks for your help!

Re: vhttpd

Posted: Mon May 24, 2021 9:38 am
by aitchon
Now that I have vhttpd working in kubernetes, I've noticed that memory has been rising while doing a load test on a vortex script. I emptied out the script so that it does nothing, and still noticed that memory still rises as seen in the attached pic. Do you know of any memory leaks within vhttpd?

Re: vhttpd

Posted: Mon May 24, 2021 4:59 pm
by John
No known memory leaks. How many requests would have occurred in that time frame?