Skip to content

Commit

Permalink
atlas_panda
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaeno committed May 24, 2022
1 parent e073478 commit 4b82650
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM docker.io/centos:7

RUN yum update -y
RUN yum install -y epel-release
RUN yum install -y python3 python3-devel httpd httpd-devel gcc gridsite less git
RUN yum install -y python3 python3-devel httpd httpd-devel gcc gridsite less git psmisc
RUN yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
RUN yum install -y postgresql14
RUN python3 -m venv /opt/panda
Expand Down
24 changes: 20 additions & 4 deletions templates/init.d/panda_httpd.exe.template
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ ARGV="$@"
# the path to your httpd binary, including options if necessary
HTTPD='/usr/sbin/httpd'

# PID
PID_OLD=/var/log/panda/panda_server_httpd.pid
PID_NEW=/var/lock/subsys/panda_server_httpd.pid
#
# a command that outputs a formatted text version of the HTML at the
# url given on the command line. Designed for lynx, however other
Expand Down Expand Up @@ -108,14 +111,27 @@ ERROR=$?
}

function check_pidfile () {
if [ -r /var/log/panda/panda_server_httpd.pid ]; then
if [ -r $PID_OLD ]; then
COMSTR=`echo $HTTPD $OPTIONS -k $ARGV`
COMSTR=`echo $COMSTR | sed -e 's/ //g'`
PSOUT=`ps -f -p \`cat /var/log/panda/panda_server_httpd.pid\` | cat | tail -1`
PSOUT=`ps -f -p \`cat $PID_OLD\` | cat | tail -1`
PSOUT=`echo $PSOUT | sed -e 's/ //g'`
if [ ! `echo $PSOUT | grep $COMSTR` ]; then
echo "check pid: deleting /var/log/panda/panda_server_httpd.pid"
rm -rf /var/log/panda/panda_server_httpd.pid
echo "check pid: deleting $PID_OLD"
rm -rf $PID_OLD
retval=0
else
echo "check pid: httpd is running"
retval=1
fi
elif [ -r $PID_NEW ]; then
COMSTR=`echo $HTTPD $OPTIONS -k $ARGV`
COMSTR=`echo $COMSTR | sed -e 's/ //g'`
PSOUT=`ps -f -p \`cat $PID_NEW\` | cat | tail -1`
PSOUT=`echo $PSOUT | sed -e 's/ //g'`
if [ ! `echo $PSOUT | grep $COMSTR` ]; then
echo "check pid: deleting $PID_NEW"
rm -rf $PID_NEW
retval=0
else
echo "check pid: httpd is running"
Expand Down

0 comments on commit 4b82650

Please sign in to comment.