Hello everyone,
I recently tried to install and run Felix 3.0.2 on Gentoo Linux. For this
purpose, I created a start script to start and stop Felix depending on the
current runlevel (see below). Gentoo's start-stop-daemon usually is a great
choice to achieve that goal, but in this case, I am running into the following
issues:
When I start Felix using /etc/init.d/felix start, I can see the process as well
as the shell's output in the logs. However, as soon as I log out, the felix
process is killed immediately (despite the --background option to the
start-stop-daemon). In addition, when I start typing in the shell that was used
to start Felix, e. g. to do a "ps aux" to list the running processes", every
second character hit is not echoed to the shell.
All this indicated a connection to the Felix shell (gogo), and the only way to
solve the problem was by removing all gogo bundles from <felix_home>/bundle.
After that, the start-stop-daemon behaved as intended and the login shell kept
working as expected.
Now I guess my question would be: did I miss anything, i. e. is there a way to
start felix using java -jar <felix_home/felix.jar that starts felix in a daemon
mode?
Thanks for any hint on this!
Tobias
/etc/conf.d/felix:
============
# felix filesystem layout
FELIX_HOME="/usr/share/felix"
FELIX_CONFDIR="/etc/felix"
FELIX_LOGDIR="/var/log/felix"
FELIX_TEMPDIR="/var/tmp/felix"
# felix configuration
FELIX_BUNDLECACHE="${FELIX_TEMPDIR}/felix-cache"
FELIX_FILEINSTALL_OPTS="-Dfelix.fileinstall.dir=${FELIX_HOME}/load"
PAX_CONFMAN_OPTS="-Dbundles.configuration.location=${FELIX_CONFDIR}"
PAX_LOGGING_OPTS="-Dorg.ops4j.pax.logging.DefaultServiceLog.level=WARN"
# Runtime environment setup
LOG_FILE="${FELIX_LOGDIR}/felix.out"
PID_FILE="/var/run/felix.pid"
FELIX_USER="felix"
FELIX_GROUP="felix"
# JVM configuration
JAVA_HOME="$(java-config --jre-home)"
JVM_MEMORY_OPTS="-Xmx1024m -Xms512m"
JVM_ENCODING_OPTS="-Dfile.encoding=utf-8"
# Java options and commandline
FELIX_OPTS="${FELIX_FILEINSTALL_OPTS} ${PAX_CONFMAN_OPTS} ${PAX_LOGGING_OPTS}"
JVM_OPTS="-server ${JVM_MEMORY_OPTS} ${JVM_ENCODING_OPTS}"
# Final command
RUN_CMD="${JAVA_HOME}/bin/java"
RUN_OPTS="${JVM_OPTS} ${FELIX_OPTS} -jar ${FELIX_HOME}/bin/felix.jar
${FELIX_BUNDLECACHE}"
/etc/init.d/felix:
===========
#!/sbin/runscript
# Distributed under the terms of the GNU General Public License v2
depend() {
use net
after logger
}
start() {
ebegin "Starting Felix"
mkdir -p "${FELIX_LOGDIR}" "${FELIX_BUNDLECACHE}"
chown -R ${FELIX_USER}:${FELIX_GROUP} "${FELIX_LOGDIR}"
"${FELIX_BUNDLECACHE}"
if [ ! -d "${FELIX_HOME}" ]; then
eerror "Felix home directory ${FELIX_HOME} not found"
return 1
fi
start-stop-daemon --start \
--background \
--user ${FELIX_USER} \
--group ${FELIX_GROUP} \
--chdir ${FELIX_HOME} \
--make-pidfile \
--pidfile "${PID_FILE}" \
--stdout "${LOG_FILE}" \
--stderr "${LOG_FILE}" \
--exec "${RUN_CMD}" -- ${RUN_OPTS}
eend $result
}
stop() {
ebegin "Stopping Felix"
start-stop-daemon --stop \
--pidfile "${PID_FILE}"
if [ -e "${PID_FILE}" ]; then
rm "${PID_FILE}"
fi
eend $?
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]