GithubHelp home page GithubHelp logo

Start Keybox as service about bastillion HOT 11 CLOSED

ausip avatar ausip commented on August 22, 2024
Start Keybox as service

from bastillion.

Comments (11)

ausip avatar ausip commented on August 22, 2024 2

Thanks @skavanagh, this is what I came up with after reading the document you provided the link to.

After verifying that Jetty and KeyBox were working correctly, I used the following procedure to setup, test and run Jetty / Keybox as a service on CentOS

mkdir /usr/local/KeyBox-jetty/jetty/temp
useradd --user-group --shell /bin/false --home-dir /usr/local/KeyBox-jetty/jetty/temp keybox
chown -R keybox /usr/local/KeyBox-jetty

cp /usr/local/KeyBox-jetty/jetty/bin/jetty.sh /etc/init.d/keybox
echo "JETTY_HOME=/usr/local/KeyBox-jetty/jetty" > /etc/default/keybox
echo "JETTY_BASE=/usr/local/KeyBox-jetty/jetty" >> /etc/default/keybox
echo "TMPDIR=/usr/local/KeyBox-jetty/jetty/temp" >> /etc/default/keybox

service keybox status
service keybox start

chkconfig keybox on

Jetty / Keybox now starts as a service, automatically on startup. It would be great if I could turn off the verbose mode though.

from bastillion.

skavanagh avatar skavanagh commented on August 22, 2024

It just uses jetty, so these instructions should help

https://www.eclipse.org/jetty/documentation/current/startup-unix-service.html#d0e8663

I think the only difference is you would copy jetty.sh from /KeyBox-jetty/jetty/bin and
then set JETTY_HOME to /KeyBox-jetty/jetty

from bastillion.

skavanagh avatar skavanagh commented on August 22, 2024

I know you can set

jetty.log.retain=90
jetty.logs=logs

in the KeyBox-jetty/jetty/modules/logging.mod file and that will setup log files and rotation for stderr/stdout. There should be a way to set the logging levels too.

from bastillion.

tvb avatar tvb commented on August 22, 2024

This worked for me. Put the following in your /etc/init/ directory:

description "Keybox"
  start on runlevel [2345]
  stop on runlevel [06]
  respawn
  respawn limit 10 5
  env JETTY_HOME=/home/keybox/jetty
  env JETTY_BASE=/home/keybox/jetty
  env TMPDIR=/home/keybox/jetty/temp

  script
    export HOME="/home/keybox"
    cd $HOME/jetty/
    exec sudo -u keybox java -Xms1024m -Xmx1024m -jar start.jar
  end script

I have the jetty files in /home/keybox/jetty located.

from bastillion.

alexolivan avatar alexolivan commented on August 22, 2024

I tried to figure out how to create a Debian/Ubuntu init.d script, but being all this java / jetty stuff I have to admit this gets too complex to me...

I have tried to adapt somo script from logstash/Elasticsearch but no success...
Being a headless software, it would be great to have it "server friendly/ready"... hope some of you could help me.

Best regards!

from bastillion.

skavanagh avatar skavanagh commented on August 22, 2024

You should just be able to follow the quick start instructions...

http://www.eclipse.org/jetty/documentation/current/startup-unix-service.html

your JETTY_HOME would need to be set to //KeyBox-jetty/
jetty

On Thu, Oct 22, 2015 at 4:35 AM, Alejandro Olivan Alvarez <
[email protected]> wrote:

I tried to figure out how to create a Debian/Ubuntu init.d script, but
being all this java / jetty stuff I have to admit this gets too complex to
me...

I have tried to adapt somo script from logstash/Elasticsearch but no
success...
Being a headless software, it would be great to have it "server
friendly/ready"... hope some of you could help me.

Best regards!


Reply to this email directly or view it on GitHub
#81 (comment).

from bastillion.

alexolivan avatar alexolivan commented on August 22, 2024

...I looked at it yestarday... being a Debian creature, I'm reluctant to add things on init.d folder that are not hortodox-debian-style LSB init scripts... So a first look at jetty.sh was somehow scaring to me.

Today a gave a second chance, basically following ausip steps posted in this same thread (which seems a lot to what I readed in the jetty linked site ...)

Starting fails that way...
Failed to start keybox.service: Unit keybox.service failed to load: No such file or directory.

Obviously something is missing or lacks pertinent permissions, the problem is what, and where this info (and presumably next errors) can be gethered.

Thank you for your help!
Regards

from bastillion.

Fratotec avatar Fratotec commented on August 22, 2024

on Ubuntu 16.0.4
apt-get install jetty9
copy KeyBox-jetty/jetty/webapps/keybox.xml to /var/lib/jetty9/webapps
copy KeyBox-jetty/jetty/keybox to /opt/keybox
ln -s /opt/keybox /usr/share/jetty9/
rm -rf /var/lib/jetty/webapps/root
chown jetty /opt/keybox/WEB-INF/classes/keydb/keybox.mv.db
systemctl start jetty9

from bastillion.

sebabordon avatar sebabordon commented on August 22, 2024

@Fratotec I've followed your instructions but I've received the error:

java.lang.RuntimeException: Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil
.class from jar file:/opt/keybox/WEB-INF/lib/log4j-api-2.9.1.jar

It seems that the jetty9 version does not support log4j (on ubuntu 16.04

from bastillion.

Fratotec avatar Fratotec commented on August 22, 2024

Perhaps an issue with the newer version ?
I used keybox-jetty-v2.90_01.tar.gz, and the log4j libs are
/opt/keybox/WEB-INF/lib/log4j-api-2.8.2.jar
/opt/keybox/WEB-INF/lib/log4j-slf4j-impl-2.8.2.jar
/opt/keybox/WEB-INF/lib/log4j-core-2.8.2.jar

from bastillion.

sebabordon avatar sebabordon commented on August 22, 2024

Here I have

seba@gw:~$ ls /opt/keybox/WEB-INF/lib/lo* -1
/opt/keybox/WEB-INF/lib/log4j-api-2.9.1.jar
/opt/keybox/WEB-INF/lib/log4j-core-2.9.1.jar
/opt/keybox/WEB-INF/lib/log4j-slf4j-impl-2.9.1.jar

Maybe it's that!

from bastillion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.