Hi Aaron,

We use OM 4.0.9 on centos (well redhat ) 7.6. Working well. We
actually implemented mls selinux policy for it. Different story for a
different day.

Since redhat has moved away from init.d towards systemd, we
implemented our own systemd service file and wrapper script. Welcome
to use ours.

controlled via
systemctl start openmeetings
systemctl stop openmeetings
systemctl enable openmeetings
systemctl disable openmeetings

.service file:
[Unit]
Description=Openmeetings
Wants=multi-user.target
After=multi-user.target


[Service]
ExecStart=/usr/bin/openmeetings-systemctl-wrapper.sh
PIDFile=/var/run/openmeetings.pid

[Install]
WantedBy=multi-user.target
Alias=openmeetings.service

systemctl wrapper script(maybe not needed for you, needed for our mls bits):
#!/bin/sh
RHEL_MAJOR=`lsb_release -sr | cut -c1`
export OPENMEETINGS_CONFIG=/etc/openmeetings/openmeetings.conf
export DNAME=`basename $0 | cut -d- -f2`
export LEVEL=`grep "^$DNAME:" $OPENMEETINGS_CONFIG 2>/dev/null | cut -d: -f2 `
export DEFAULT_LEVEL="...."
export RED5_HOME=/opt/red5

PID=0
RTMPPORT=1935
prog="red5"
retval=0
lockfile=/var/lock/subsys/$prog

echo -n $"Starting openmeetings daemon ($prog): "
if [ -z "$LEVEL" ]; then LEVEL=$DEFAULT_LEVEL; fi

/bin/newrole -l "$LEVEL-$LEVEL" -- -c '/opt/red5/openmeetings-wrapper.sh'

openmeetings wrapper script:
#!/bin/bash
export RED5_HOME=/var/opt/red5

JAVA_BIN=`readlink /etc/alternatives/java`
JAVA_BIN=`dirname $JAVA_BIN`
export TMPDIR=${RED5_HOME}/tmp
export _JAVA_OPTIONS=-Djava.io.tmpdir=${RED5_HOME}/tmp
export OSL_SOCKET_PATH=${RED5_HOME}/tmp
mkdir -p ${RED5_HOME}/tmp 2>/dev/null >/dev/null
RT_JAR=${JAVA_BIN}/../lib/rt.jar
export CLASSPATH="${CLASSPATH}:${RT_JAR}"
export 
CLASSPATH="${CLASSPATH}:${RED5_HOME}/red5-service.jar:${RED5_HOME}/red5-server.jar"
for jarfile in ${RED5_HOME}/lib/*.jar ; do
if [ $jarfile = "${RED5_HOME}/lib/javax.servlet_3.0.0.v201112011016.jar" ]; then
continue
fi
export CLASSPATH=${CLASSPATH}:$jarfile
done
for jarfile in ${RED5_HOME}/plugins/*.jar ; do
export CLASSPATH=${CLASSPATH}:$jarfile
done
/opt/red5/red5.sh 1> $RED5_HOME/log/stdout.log 2> $RED5_HOME/log/stderr.log

On Fri, Jul 19, 2019 at 7:41 PM Maxim Solodovnik <solomax...@gmail.com> wrote:
>
> Hello Aaron,
>
> It's been a long time I use CentOS
> From what I do remember it doesn't have `start-stop-daemon` by default
> I was able to build it from sources and to use
>
> According "foreground job" /etc/init.d/* are usual shell scripts
> you should be able to run any command in it as both background and
> foreground process using `&`
> i.e. if you have `start-stop-daemon` and it works just edit init.d
> script by appending `&` like this: `start-stop-daemon ... all params
> here.........  &`
>
> On Sat, 20 Jul 2019 at 05:05, Aaron Hepp <aaron.h...@gmail.com> wrote:
> >
> > Moving everything to CentOS servers from Ubuntu.  The start up script used 
> > to start OM4 in Ubuntu was just /etc/init.d/<startup script> start.  It 
> > then started in the background with a few lines:
> >    start-stop-daemon: --start needs --exec or --startas
> >    Try 'start-stop-daemon --help' for more information.
> >
> > You cannot use the same command in CentOS as if you do it runs the script 
> > in the foreground, which as soon as you stop the terminal it kills the 
> > process.
> >
> > Know of another way to run the script in the background?  I have tried 
> > /etc/init.d/<startup script> start & and that does not work
> >
>
>
> --
> WBR
> Maxim aka solomax

Reply via email to