Note! I (steinarb) has stopped using this karaf debian packaging. I have switched to https://github.com/steinarb/karaf-debian that uses native debian packaging tools, and is built from a karaf source tarball instead of using the karaf binary tarball.
Simple debian packaging for Apache Karaf
Forked from https://github.com/DemisR/karaf-deb-packaging and modified to use openjdk instead of Oracle Java, and modified to use the provided startup scripts instead of the proprietary karaf-wrapper.
- Debian Jessie, amd64 (karaf 4.0.7)
- Debian Stretch, amd64 (karaf 4.0.7, karaf 4.1.1 and karaf 4.1.2)
- Install the pre-requisites (commands done as root)
apt-get update apt-get install git maven openjdk-8-jdk postgresql ruby ruby-dev build-essential gem install fpm
- How to create the .deb
cd /tmp git clone https://github.com/steinarb/karaf-deb-packaging cd karaf-deb-packaging ./dist_karaf.sh mkdir -p /root/debs cp *.deb /root/debs
- How to install the .deb package
dpkg --install karaf_4.1.2-1_all.deb
Since forking https://github.com/DemisR/karaf-deb-packaging I have made the following changes:
- Switched from oracle JDK 8, to openjdk 8
- Updated to karaf version 4.0.7 (the currently newest stable release at the time of forking), later upgraded to karaf 4.1.1 and again upgraded to karaf 4.1.2
- Use /var/lib/karaf/data instead of /usr/local/karaf/data
- Use package version "-1" instead of "-3" (this is the first 4.0.7 version of the package)
- Switched from using the the service wrapper (karaf-wrapper) to plain systemd start using the scripts and config from bin/contrib in the karaf 4.0.7 distro
- Clone the project
cd /tmp git clone https://github.com/steinarb/karaf-deb-packaging
- Modify the karaf version in the /tmp/karaf-dep-packaging/dist_karaf.sh file:
name=karaf version=4.1.2 package_version="-1" ./dist_karaf.sh
- Build the deb package
cd /tmp/karaf-deb-packaging ./dist_karaf.sh
- Uninstall the installed package and install the new package (using version 4.1.2 for the new package in the example, must be done as root):
dpkg --purge karaf dpkg --install /root/debs/karaf_4.1.2-1_all.deb
ssh -p 8101 karaf@localhost
Debian pkg: karaf_4.1.2-1_all.deb
Version :
- karaf 4.1.2
Systemd service config:
- /lib/systemd/system/karaf.service
- /lib/systemd/system/karaf@.service
Configuration:
- /etc/karaf
- /etc/default/karaf
Logs:
- /var/log/syslog
Binaries:
- /usr/local/karaf/bin/
Data:
- /usr/local/karaf/data
Network ports:
- karaf shell: 8101
Users:
- karaf : karaf
feature:install jolokia
Default config http://hostname:8181/jolokia karaf/karaf