diff options
author | pappy | 2020-09-22 08:38:50 +0200 |
---|---|---|
committer | pappy | 2020-09-22 12:30:55 +0200 |
commit | 130a5bb934f92e02d74c5272e3e61c507653c941 (patch) | |
tree | 83d9daff1515e8e511c2d9edbf636a9b998fa3be | |
parent | 9073e7cb2c7d39e5549ce5b80e56bde2e7fb5226 (diff) | |
download | aur-130a5bb934f92e02d74c5272e3e61c507653c941.tar.gz |
2.14.18
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | 01-paths.patch | 94 | ||||
-rw-r--r-- | PKGBUILD | 83 | ||||
-rw-r--r-- | aliases.sh | 13 | ||||
-rw-r--r-- | dockerfile.txt | 15 | ||||
-rwxr-xr-x | nexus | 551 | ||||
-rw-r--r-- | nexus.install | 131 | ||||
-rw-r--r-- | nexus.properties | 29 | ||||
-rw-r--r-- | nexus.service | 10 | ||||
-rw-r--r-- | nexus.sysusers | 2 | ||||
-rw-r--r-- | nexus.tmpfiles | 5 |
11 files changed, 291 insertions, 670 deletions
@@ -1,14 +1,12 @@ pkgbase = nexus pkgdesc = Nexus 2 Repository Manager (OSS) - pkgver = 2.14.13.01 - pkgrel = 2 + pkgver = 2.14.18.01 + pkgrel = 1 url = http://nexus.sonatype.org install = nexus.install arch = any license = GPL3 - depends = java-environment - optdepends = apache: a full featured webserver - optdepends = maven: a java project management and project comprehension tool + depends = java-environment=8 provides = nexus2 provides = nexus conflicts = nexus2 @@ -16,15 +14,19 @@ pkgbase = nexus conflicts = nexus-oss options = !strip options = !docs - backup = opt/nexus/bin/jsw/conf/wrapper.conf - source = http://www.sonatype.org/downloads/nexus-2.14.13-01-bundle.tar.gz - source = http://wrapper.tanukisoftware.com/download/3.5.26/wrapper-delta-pack-3.5.26.tar.gz - source = nexus + backup = usr/lib/nexus/conf/nexus.properties + source = https://www.sonatype.org/downloads/nexus-2.14.18-01-bundle.tar.gz + source = https://wrapper.tanukisoftware.com/download/3.5.43/wrapper-delta-pack-3.5.43.tar.gz + source = nexus.sysusers + source = nexus.tmpfiles source = nexus.service - sha256sums = 66e2ae803af26c6af34a82cc510d7fa2037080f35a72b4398f65d2f157fd3afc - sha256sums = 635e545fde9c8728e4d7126859cab286637d565f041ce63596f5361fb85fc924 - sha256sums = 945e2fa64d6096416edd60c2a98c0ed385aee00f6bb3b33f6cbbc428b6b47d07 - sha256sums = b89aaee6f035d7be20af5b738ed3b892df7f4db6538f9b7ec3c3f54685bbe7f8 + source = 01-paths.patch + sha256sums = 350af8b270bec7fda5861a15b8a5b7870fd8903d0b9a210754113d5a966ce6a6 + sha256sums = eb25cd3a4d63e1540daf37f90820ce48befe673071fcf2ba37f3773654498de1 + sha256sums = 9a5908103137af8176664ddb17d166183aa19cd455746d08f0f58a1a3d9f4eb2 + sha256sums = e4110396c5c2c617f6bc37bbd3cf4c6fa9da72df7df6d035117dea39f3e24ac9 + sha256sums = a62d439d727c1eced9341ad5fedbc1a5a42494925b01c559e6426c46bbf55c25 + sha256sums = 9136aee79732184e1da6cfeca0a77708d0595a35b2e38b16cf28a1b41ae7429d pkgname = nexus diff --git a/01-paths.patch b/01-paths.patch new file mode 100644 index 000000000000..c410115010d0 --- /dev/null +++ b/01-paths.patch @@ -0,0 +1,94 @@ +diff -rNc nexus-2.14.18-01-orig/bin/jsw/conf/wrapper.conf nexus-2.14.18-01/bin/jsw/conf/wrapper.conf +*** nexus-2.14.18-01-orig/bin/jsw/conf/wrapper.conf Mon May 18 13:59:42 2020 +--- nexus-2.14.18-01/bin/jsw/conf/wrapper.conf Tue Sep 22 08:26:29 2020 +*************** +*** 26,32 **** + wrapper.java.library.path.1=bin/jsw/lib + + # Additional JVM parameters (tune if needed, but match the sequence of numbers!) +! wrapper.java.additional.1=-Djava.io.tmpdir=./tmp + wrapper.java.additional.2=-Djava.net.preferIPv4Stack=true + wrapper.java.additional.3=-Dcom.sun.jndi.ldap.connect.pool.protocol="plain ssl" + wrapper.java.additional.3.stripquotes=TRUE +--- 26,32 ---- + wrapper.java.library.path.1=bin/jsw/lib + + # Additional JVM parameters (tune if needed, but match the sequence of numbers!) +! wrapper.java.additional.1=-Djava.io.tmpdir=/var/lib/nexus/tmp + wrapper.java.additional.2=-Djava.net.preferIPv4Stack=true + wrapper.java.additional.3=-Dcom.sun.jndi.ldap.connect.pool.protocol="plain ssl" + wrapper.java.additional.3.stripquotes=TRUE +*************** +*** 58,64 **** + wrapper.on_exit.12=RESTART + + # Set up JSW logging +! wrapper.logfile=logs/wrapper.log + wrapper.logfile.format=PM + wrapper.logfile.loglevel=INFO + wrapper.logfile.maxsize=10m +--- 58,64 ---- + wrapper.on_exit.12=RESTART + + # Set up JSW logging +! wrapper.logfile=/var/log/nexus/wrapper.log + wrapper.logfile.format=PM + wrapper.logfile.loglevel=INFO + wrapper.logfile.maxsize=10m +diff -rNc nexus-2.14.18-01-orig/bin/nexus nexus-2.14.18-01/bin/nexus +*** nexus-2.14.18-01-orig/bin/nexus Mon May 18 13:59:42 2020 +--- nexus-2.14.18-01/bin/nexus Tue Sep 22 08:26:29 2020 +*************** +*** 11,17 **** + # These settings can be modified to fit the needs of your application + + # Set this to the root of the Nexus installation +! NEXUS_HOME=".." + + # If specified, the Wrapper will be run as the specified user. + +--- 11,17 ---- + # These settings can be modified to fit the needs of your application + + # Set this to the root of the Nexus installation +! NEXUS_HOME="/usr/lib/nexus" + + # If specified, the Wrapper will be run as the specified user. + +*************** +*** 31,37 **** + PRIORITY= + + # Location of the pid file. +! #PIDDIR="." + + # If uncommented, causes the Wrapper to be shutdown using an anchor file. + # When launched with the 'start' command, it will also ignore all INT and +--- 31,37 ---- + PRIORITY= + + # Location of the pid file. +! PIDDIR="/run/nexus" + + # If uncommented, causes the Wrapper to be shutdown using an anchor file. + # When launched with the 'start' command, it will also ignore all INT and +diff -rNc nexus-2.14.18-01-orig/conf/nexus.properties nexus-2.14.18-01/conf/nexus.properties +*** nexus-2.14.18-01-orig/conf/nexus.properties Mon May 18 13:59:42 2020 +--- nexus-2.14.18-01/conf/nexus.properties Tue Sep 22 08:37:42 2020 +*************** +*** 22,28 **** +! nexus-webapp-context-path=/nexus + + # Nexus section +! nexus-work=${bundleBasedir}/../sonatype-work/nexus + runtime=${bundleBasedir}/nexus/WEB-INF + + # orientdb buffer size in megabytes +--- 22,28 ---- +! nexus-webapp-context-path=/ + + # Nexus section +! nexus-work=/var/lib/nexus + runtime=${bundleBasedir}/nexus/WEB-INF + + # orientdb buffer size in megabytes @@ -1,59 +1,72 @@ # Maintainer: PAPPY <pappy _AT_ a s c e l i o n _DOT_ com> -_version=2.14.13 +_version=2.14.18 _patch=01 +# wrapper version +_wersion=3.5.43 + pkgname=nexus -pkgver=${_version}.${_patch} -pkgrel=2 +pkgver=$_version.$_patch +pkgrel=1 pkgdesc="Nexus 2 Repository Manager (OSS)" url="http://nexus.sonatype.org" arch=('any') license=('GPL3') -depends=('java-environment') -optdepends=('apache: a full featured webserver' - 'maven: a java project management and project comprehension tool') - +depends=('java-environment=8') install=nexus.install -backup=(opt/nexus/bin/jsw/conf/wrapper.conf) +backup=(usr/lib/nexus/conf/nexus.properties) conflicts=(nexus2 nexus3 nexus-oss) provides=(nexus2 nexus) options=(!strip !docs) -source=("http://www.sonatype.org/downloads/nexus-$_version-$_patch-bundle.tar.gz" - 'http://wrapper.tanukisoftware.com/download/3.5.26/wrapper-delta-pack-3.5.26.tar.gz' - 'nexus' - 'nexus.service') - -sha256sums=('66e2ae803af26c6af34a82cc510d7fa2037080f35a72b4398f65d2f157fd3afc' - '635e545fde9c8728e4d7126859cab286637d565f041ce63596f5361fb85fc924' - '945e2fa64d6096416edd60c2a98c0ed385aee00f6bb3b33f6cbbc428b6b47d07' - 'b89aaee6f035d7be20af5b738ed3b892df7f4db6538f9b7ec3c3f54685bbe7f8') +source=("https://www.sonatype.org/downloads/nexus-$_version-$_patch-bundle.tar.gz" + "https://wrapper.tanukisoftware.com/download/$_wersion/wrapper-delta-pack-$_wersion.tar.gz" + nexus.sysusers + nexus.tmpfiles + nexus.service + 01-paths.patch + ) -package() { - cd ${srcdir} +sha256sums=('350af8b270bec7fda5861a15b8a5b7870fd8903d0b9a210754113d5a966ce6a6' + 'eb25cd3a4d63e1540daf37f90820ce48befe673071fcf2ba37f3773654498de1' + '9a5908103137af8176664ddb17d166183aa19cd455746d08f0f58a1a3d9f4eb2' + 'e4110396c5c2c617f6bc37bbd3cf4c6fa9da72df7df6d035117dea39f3e24ac9' + 'a62d439d727c1eced9341ad5fedbc1a5a42494925b01c559e6426c46bbf55c25' + '9136aee79732184e1da6cfeca0a77708d0595a35b2e38b16cf28a1b41ae7429d') - # Create directories - install -d $pkgdir/opt/nexus - +prepare() +{ + cd $srcdir/nexus-$_version-$_patch - # move documentation to the right location - mkdir -p $pkgdir/usr/share/doc/nexus - install $srcdir/nexus-$_version-$_patch/*.txt $pkgdir/usr/share/doc/nexus - rm $srcdir/nexus-$_version-$_patch/*.txt + for s in ${source[@]}; do + case $s in + *.patch) + echo -n Applying patch $s... + patch -s -p1 -i $srcdir/$s + echo ' done' + ;; + esac + done +} - # move example configuration to the right location - mkdir -p $pkgdir/usr/share/doc/nexus/conf +package() +{ + cd $srcdir/nexus-$_version-$_patch - mkdir -p $pkgdir/opt/sonatype-work - mkdir -p $pkgdir/opt/nexus/run + install -dm755 $pkgdir/usr/lib + install -dm755 $pkgdir/usr/share/doc/nexus + cp -r . $pkgdir/usr/lib/nexus - # copy the source to the final directory - cp -a $srcdir/nexus-$_version-${_patch}/* $pkgdir/opt/nexus || return 1 - install $srcdir/nexus $pkgdir/opt/nexus/bin/nexus + rm -rf $pkgdir/usr/lib/nexus/{tmp,logs,bin/nexus.bat} - #install $srcdir/nexus.properties $pkgdir/opt/nexus/conf/nexus.properties || return 1 + # move documentation to the right location + mv $pkgdir/usr/lib/nexus/*.txt $pkgdir/usr/share/doc/nexus - install -Dm644 "${srcdir}/nexus.service" "${pkgdir}/usr/lib/systemd/system/nexus.service" + #install $srcdir/nexus.properties $pkgdir/opt/nexus/conf/nexus.properties || return 1 + install -Dm644 $srcdir/nexus.service $pkgdir/usr/lib/systemd/system/nexus.service + install -Dm644 $srcdir/nexus.sysusers $pkgdir/usr/lib/sysusers.d/nexus.conf + install -Dm644 $srcdir/nexus.tmpfiles $pkgdir/usr/lib/tmpfiles.d/nexus.conf } + diff --git a/aliases.sh b/aliases.sh new file mode 100644 index 000000000000..3e3fffa34f7a --- /dev/null +++ b/aliases.sh @@ -0,0 +1,13 @@ +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +alias vi=vim +alias ls='ls --color=auto' +alias l='ls -h -l' +alias ll='l -l' +alias la='l -la' +alias df='df -h' +alias du='du -h' +alias ..='cd ..' +alias ...='cd .. && cd ..' + diff --git a/dockerfile.txt b/dockerfile.txt new file mode 100644 index 000000000000..44b84ea0b5b8 --- /dev/null +++ b/dockerfile.txt @@ -0,0 +1,15 @@ +FROM docker.ascelion.com/iot-arch + +ARG PASSWORD +RUN echo "machine arch.ascelion.com login iot-talkd password $PASSWORD" >/root/.netrc +RUN pacman -Syu --noconfirm +RUN pacman -S --needed --noconfirm jdk8-openjdk + +RUN useradd -u 1000 -m build +RUN echo "build ALL=(ALL) NOPASSWD: ALL" >/etc/sudoers.d/build +VOLUME /home/build + +ENTRYPOINT ["tail", "-f", "/dev/null"] + +ADD aliases.sh /etc/profile.d + diff --git a/nexus b/nexus deleted file mode 100755 index 797037681c86..000000000000 --- a/nexus +++ /dev/null @@ -1,551 +0,0 @@ -#! /bin/sh - -# -# Copyright (c) 1999, 2006 Tanuki Software Inc. -# -# Java Service Wrapper sh script. Suitable for starting and stopping -# wrapped Java applications on UNIX platforms. -# - -#----------------------------------------------------------------------------- -# These settings can be modified to fit the needs of your application - -# Set this to the root of the Nexus installation -export NEXUS_HOME=${NEXUS_HOME:=/opt/nexus} -export NEXUS_RUN_DIR=${NEXUS_RUN_DIR:=/opt/nexus/run} - - -# If specified, the Wrapper will be run as the specified user. - -# IMPORTANT - Make sure that the user has the required privileges to write into the Nexus installation directory. - -# NOTE - This will set the user which is used to run the Wrapper as well as -# the JVM and is not useful in situations where a privileged resource or -# port needs to be allocated prior to the user being changed. -RUN_AS_USER=nexus - -# Application -APP_NAME="nexus" -APP_LONG_NAME="Nexus OSS" - -# Priority at which to run the wrapper. See "man nice" for valid priorities. -# nice is only used if a priority is specified. -PRIORITY= - -# Location of the pid file. -PIDDIR="$NEXUS_RUN_DIR" - -# If uncommented, causes the Wrapper to be shutdown using an anchor file. -# When launched with the 'start' command, it will also ignore all INT and -# TERM signals. -#IGNORE_SIGNALS=true - -# The following two lines are used by the chkconfig command. Change as is -# appropriate for your application. They should remain commented. -# chkconfig: 2345 20 80 -# description: Test Wrapper Sample Application - -# Do not modify anything beyond this point -#----------------------------------------------------------------------------- - -# Get the fully qualified path to the script -case $0 in - /*) - SCRIPT="$0" - ;; - *) - PWD=`pwd` - SCRIPT="$PWD/$0" - ;; -esac - -# Resolve the true real path without any sym links. -CHANGED=true -while [ "X$CHANGED" != "X" ] -do - # Change spaces to ":" so the tokens can be parsed. - SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` - # Get the real path to this script, resolving any symbolic links - TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` - REALPATH= - for C in $TOKENS; do - # Change any ":" in the token back to a space. - C=`echo $C | sed -e 's;:; ;g'` - REALPATH="$REALPATH/$C" - # If REALPATH is a sym link, resolve it. Loop for nested links. - while [ -h "$REALPATH" ] ; do - LS="`ls -ld "$REALPATH"`" - LINK="`expr "$LS" : '.*-> \(.*\)$'`" - if expr "$LINK" : '/.*' > /dev/null; then - # LINK is absolute. - REALPATH="$LINK" - else - # LINK is relative. - REALPATH="`dirname "$REALPATH"`""/$LINK" - fi - done - done - - if [ "$REALPATH" = "$SCRIPT" ] - then - CHANGED="" - else - SCRIPT="$REALPATH" - fi -done - -# Change the current directory to the location of the script -cd "`dirname "$REALPATH"`" -REALDIR=`pwd` - -# Resolve the location of the 'ps' command -PSEXE="/usr/bin/ps" -if [ ! -x "$PSEXE" ] -then - PSEXE="/bin/ps" - if [ ! -x "$PSEXE" ] - then - echo "Unable to locate 'ps'." - echo "Please report this message along with the location of the command on your system." - exit 1 - fi -fi - -# Resolve the os -DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` -case "$DIST_OS" in - 'sunos') - DIST_OS="solaris" - PSEXE="/usr/ucb/ps" - ;; - 'hp-ux' | 'hp-ux64') - DIST_OS="hpux" - ;; - 'darwin') - DIST_OS="macosx" - ;; - 'unix_sv') - DIST_OS="unixware" - ;; -esac - -# Resolve the architecture -DIST_ARCH=`uname -m | tr [:upper:] [:lower:] | tr -d [:blank:]` -DIST_BITS=32 -if [ "$DIST_ARCH" = "unknown" ] -then - DIST_ARCH=`uname -m | tr [:upper:] [:lower:] | tr -d [:blank:]` -fi -case "$DIST_ARCH" in - 'athlon' | 'ia32' | 'i386' | 'i486' | 'i586' | 'i686') - DIST_ARCH="x86" - ;; - 'amd64' | 'x86_64' | 'ia64') - DIST_ARCH="x86" - DIST_BITS=64 - ;; - 'ip27') - DIST_ARCH="mips" - ;; - 'power' | 'powerpc' | 'power_pc') - DIST_ARCH="ppc" - ;; - 'ppc64') - DIST_ARCH="ppc" - DIST_BITS=64 - ;; - 'pa_risc' | 'pa-risc') - DIST_ARCH="parisc" - ;; - 'sun4u' | 'sparcv9') - DIST_ARCH="sparc" - ;; - '9000/800') - DIST_ARCH="parisc" - ;; -esac - -# Extra architecture detection -case "$DIST_OS" in - 'macosx') - if [ `sysctl hw.cpu64bit_capable | awk '{ print $2 }'` = '1' ]; then - DIST_BITS=64 - fi - DIST_ARCH='universal' - ;; -esac - -outputFile() { - if [ -f "$1" ] - then - echo " $1 (Found but not executable.)"; - else - echo " $1" - fi -} - -# Test if NEXUS_HOME is relative (does not start with /). If relative it should be relative to this script location -FIRST_CHAR=`echo $NEXUS_HOME | cut -c1,1` -if [ "$FIRST_CHAR" != "/" ] -then - NEXUS_HOME=$REALDIR/$NEXUS_HOME -fi - -# Default PIDDIR to os/arch/bits directory -if [ "X$PIDDIR" = "X" ] -then - PIDDIR="bin/jsw/$DIST_OS-$DIST_ARCH-$DIST_BITS" -fi - -# If the PIDDIR is relative, set its value relative to the full NEXUS_HOME to avoid problems if -# the working directory is later changed. -FIRST_CHAR=`echo $PIDDIR | cut -c1,1` -if [ "$FIRST_CHAR" != "/" ] -then - PIDDIR=$NEXUS_HOME/$PIDDIR -fi - -# Process ID -ANCHORFILE="$PIDDIR/$APP_NAME.anchor" -PIDFILE="$PIDDIR/$APP_NAME.pid" -LOCKDIR="/var/lock/subsys" -LOCKFILE="$LOCKDIR/$APP_NAME" -pid="" - -WRAPPER_CMD="$NEXUS_HOME/bin/jsw/$DIST_OS-$DIST_ARCH-$DIST_BITS/wrapper" -if [ ! -x "$WRAPPER_CMD" ]; then - echo "Missing platform binary: $WRAPPER_CMD" - exit 1 -fi - -WRAPPER_CONF="$NEXUS_HOME/bin/jsw/conf/wrapper.conf" - -# Build the nice clause -if [ "X$PRIORITY" = "X" ] -then - CMDNICE="" -else - CMDNICE="nice -$PRIORITY" -fi - -# Build the anchor file clause. -if [ "X$IGNORE_SIGNALS" = "X" ] -then - ANCHORPROP= - IGNOREPROP= -else - ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" - IGNOREPROP=wrapper.ignore_signals=TRUE -fi - -# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. -LOCKPROP= -if [ -d $LOCKDIR ] -then - if [ -w $LOCKDIR ] - then - LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" - fi -fi - -checkUser() { - # $1 touchLock flag - # $2 command - - # Resolve the location of the 'id' command - IDEXE="/usr/xpg4/bin/id" - if [ ! -x "$IDEXE" ] - then - IDEXE="/usr/bin/id" - if [ ! -x "$IDEXE" ] - then - echo "Unable to locate 'id'." - echo "Please report this message along with the location of the command on your system." - exit 1 - fi - fi - - # Check the configured user. If necessary rerun this script as the desired user. - if [ "X$RUN_AS_USER" != "X" ] - then - if [ "`$IDEXE -u -n`" != "$RUN_AS_USER" ] - then - # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be - # able to create the lock file. The Wrapper will be able to update this file once it - # is created but will not be able to delete it on shutdown. If $2 is defined then - # the lock file should be created for the current command - if [ "X$LOCKPROP" != "X" ] - then - if [ "X$1" != "X" ] - then - # Resolve the primary group - RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` - if [ "X$RUN_AS_GROUP" = "X" ] - then - RUN_AS_GROUP=$RUN_AS_USER - fi - touch $LOCKFILE - chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE - fi - fi - - # Still want to change users, recurse. This means that the user will only be - # prompted for a password once. Variables shifted by 1 - su -m $RUN_AS_USER -c "\"$REALPATH\" $2" - - # Now that we are the original user again, we may need to clean up the lock file. - if [ "X$LOCKPROP" != "X" ] - then - getpid - if [ "X$pid" = "X" ] - then - # Wrapper is not running so make sure the lock file is deleted. - if [ -f "$LOCKFILE" ] - then - rm "$LOCKFILE" - fi - fi - fi - - exit 0 - fi - fi - - # Check that script is not run as root - LUID=`$IDEXE -u` - if [ $LUID -eq 0 ] - then - echo "****************************************" - echo "WARNING - NOT RECOMMENDED TO RUN AS ROOT" - echo "****************************************" - if [ ! "`$IDEXE -u -n`" = "$RUN_AS_USER" ] - then - echo "If you insist running as root, then set the environment variable RUN_AS_USER=root before running this script." - exit 1 - fi - fi -} - -getpid() { - if [ -f "$PIDFILE" ] - then - if [ -r "$PIDFILE" ] - then - pid=`cat "$PIDFILE"` - if [ "X$pid" != "X" ] - then - # It is possible that 'a' process with the pid exists but that it is not the - # correct process. This can happen in a number of cases, but the most - # common is during system startup after an unclean shutdown. - # The ps statement below looks for the specific wrapper command running as - # the pid. If it is not found then the pid file is considered to be stale. - case "$DIST_OS" in - 'macosx') - pidtest=`$PSEXE -ww -p $pid -o command | grep "wrapper.pidfile" | tail -1` - ;; - 'solaris') - pidtest=`$PSEXE ww $pid | grep "wrapper.pidfile" | tail -1` - ;; - *) - pidtest=`$PSEXE -p $pid -o args | grep "wrapper.pidfile" | tail -1` - ;; - esac - if [ "X$pidtest" = "X" ] - then - # This is a stale pid file. - rm -f "$PIDFILE" - echo "Removed stale pid file: $PIDFILE" - pid="" - fi - fi - else - echo "Cannot read $PIDFILE." - exit 1 - fi - fi -} - -testpid() { - if [ "$DIST_OS" = "solaris" ] - then - pid=`$PSEXE ww $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` - else - pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` - fi - if [ "X$pid" = "X" ] - then - # Process is gone so remove the pid file. - rm -f "$PIDFILE" - pid="" - fi -} - -console() { - echo "Running $APP_LONG_NAME..." - getpid - if [ "X$pid" = "X" ] - then - # The string passed to eval must handles spaces in paths correctly. - COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=$APP_NAME wrapper.pidfile=\"$PIDFILE\" $ANCHORPROP $LOCKPROP" - eval $COMMAND_LINE - else - echo "$APP_LONG_NAME is already running." - exit 1 - fi -} - -start() { - echo "Starting $APP_LONG_NAME..." - getpid - if [ "X$pid" = "X" ] - then - # The string passed to eval must handles spaces in paths correctly. - COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=$APP_NAME wrapper.pidfile=\"$PIDFILE\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $LOCKPROP" - eval $COMMAND_LINE - else - echo "$APP_LONG_NAME is already running." - exit 1 - fi - getpid - if [ "X$pid" != "X" ] - then - echo "Started $APP_LONG_NAME." - else - echo "Failed to start $APP_LONG_NAME." - fi -} - -stopit() { - echo "Stopping $APP_LONG_NAME..." - getpid - if [ "X$pid" = "X" ] - then - echo "$APP_LONG_NAME was not running." - else - if [ "X$IGNORE_SIGNALS" = "X" ] - then - # Running so try to stop it. - kill $pid - if [ $? -ne 0 ] - then - # An explanation for the failure should have been given - echo "Unable to stop $APP_LONG_NAME." - exit 1 - fi - else - rm -f "$ANCHORFILE" - if [ -f "$ANCHORFILE" ] - then - # An explanation for the failure should have been given - echo "Unable to stop $APP_LONG_NAME." - exit 1 - fi - fi - - # We can not predict how long it will take for the wrapper to - # actually stop as it depends on settings in wrapper.conf. - # Loop until it does. - savepid=$pid - CNT=0 - TOTCNT=0 - while [ "X$pid" != "X" ] - do - # Show a waiting message every 5 seconds. - if [ "$CNT" -lt "5" ] - then - CNT=`expr $CNT + 1` - else - echo "Waiting for $APP_LONG_NAME to exit..." - CNT=0 - fi - TOTCNT=`expr $TOTCNT + 1` - - sleep 1 - - testpid - done - - pid=$savepid - testpid - if [ "X$pid" != "X" ] - then - echo "Failed to stop $APP_LONG_NAME." - exit 1 - else - echo "Stopped $APP_LONG_NAME." - fi - fi -} - -status() { - getpid - if [ "X$pid" = "X" ] - then - echo "$APP_LONG_NAME is not running." - exit 1 - else - echo "$APP_LONG_NAME is running ($pid)." - exit 0 - fi -} - -dump() { - echo "Dumping $APP_LONG_NAME..." - getpid - if [ "X$pid" = "X" ] - then - echo "$APP_LONG_NAME was not running." - - else - kill -3 $pid - - if [ $? -ne 0 ] - then - echo "Failed to dump $APP_LONG_NAME." - exit 1 - else - echo "Dumped $APP_LONG_NAME." - fi - fi -} - -case "$1" in - - 'console') - checkUser touchlock $1 - console - ;; - - 'start') - checkUser touchlock $1 - start - ;; - - 'stop') - checkUser "" $1 - stopit - ;; - - 'restart') - checkUser touchlock $1 - stopit - start - ;; - - 'status') - checkUser "" $1 - status - ;; - - 'dump') - checkUser "" $1 - dump - ;; - - *) - echo "Usage: $0 { console | start | stop | restart | status | dump }" - exit 1 - ;; -esac - -exit 0 diff --git a/nexus.install b/nexus.install index 295721dcff6a..e75173819e45 100644 --- a/nexus.install +++ b/nexus.install @@ -1,83 +1,80 @@ -#!/bin/sh -# $Id$ -# vim:set ts=2 sw=2 et: - -# arg 1: the new package version -pre_install() { - /bin/true +has_old_layout() +{ + test -d /opt/sonatype-work/nexus/conf && ! test -d /var/lib/nexus/conf } -# arg 1: the new package version -post_install() { - ln -s /opt/nexus/bin/nexus /etc/rc.d/nexus - - echo ">>> Creating user and group and setting permissions..." - getent group nexus > /dev/null || usr/sbin/groupadd nexus - getent passwd nexus > /dev/null || usr/sbin/useradd -c \ - 'Maven Repository Manager' -g nexus -d '/opt/nexus' \ - --system -s /bin/bash nexus &> /dev/null - - cd opt/nexus - - chown -R nexus:nexus * - chown -R nexus:nexus /opt/sonatype-work/ - chown -R nexus:nexus /opt/nexus - chown -R nexus:nexus /opt/nexus/run - - cat << EOF ->>> ->>> Systemd service file added ->>> If you would like to start it on system startup, please enable it by ->>> systemctl enable nexus.service ->>> ->>> Nexus is running by default on port 8081 and is bound to all interfaces, ->>> you can change this in the nexus.properties as well. ->>> ->>> The nexus.log can be found in /opt/nexus/logs. ->>> ->>> For additional information please visit http://nexus.sonatype.org -EOF -} +post_install() +{ + systemd-sysusers nexus.conf + systemd-tmpfiles --create nexus.conf -# arg 1: the new package version -# arg 2: the old package version -pre_upgrade() { - /bin/true -} + cat <<EOF + +The default URL for this installation is + + http://127.0.0.1:8081/ + +To change these settings edit the file + + /usr/lib/nexus/conf/nexus.properties -# arg 1: the new package version -# arg 2: the old package version -post_upgrade() { - cd opt/nexus +All logs can be found at - chown -R nexus:nexus * - chown -R nexus:nexus /opt/sonatype-work - chown -R nexus:nexus /opt/nexus - chown -R nexus:nexus /opt/nexus/run + /var/log/nexus +Sonatype strongly suggests using the latest Java 8 release version of Java +available from Oracle. Support for Java 9 has not been verified - DO NOT USE IT. + +See https://help.sonatype.com/repomanager2/system-requirements + +EOF } -# arg 1: the old package version -pre_remove() { - /bin/true +pre_upgrade() +{ + if has_old_layout; then + systemctl disable --now nexus + fi } -# arg 1: the old package version -post_remove() { - getent passwd nexus > /dev/null && usr/sbin/userdel nexus &>/dev/null - getent group nexus > /dev/null && usr/sbin/groupdel nexus &>/dev/null +post_upgrade() +{ + systemctl daemon-reload + + cat <<EOF - if [ -d /opt/nexus/run ] ; then - rm -r /opt/nexus/run - fi +See Release Notes at + https://help.sonatype.com/repomanager2/release-notes/2020-release-notes - if [ -d /opt/sonatype-work ] ; then - rm -r /opt/sonatype-work - fi +EOF + + if has_old_layout; then + echo ">>>" + echo ">>>" + echo ">>> Found old Nexus package layout." + echo ">>>" + echo ">>> You need to move all the content of /opt/sonatype-work/nexus" + echo ">>> to /var/log/nexus and /var/lib/nexus, e.g." + echo ">>>" + echo ">>> mv /opt/sonatype-work/nexus/logs/* /var/log/nexus" + echo ">>> rm -rf /opt/sonatype-work/nexus/logs" + echo ">>> mv /opt/sonatype-work/nexus/* /var/lib/nexus" + echo ">>>" + echo ">>> Re-enable nexus.service if needed" + echo ">>>" + echo ">>> systemctl enable --now nexus.service" + echo ">>>" + echo ">>>" + fi +} - if [ -h /etc/rc.d/nexus ] ; then - rm /etc/rc.d/nexus - fi +pre_remove() +{ + systemctl disable --now nexus +} +post_remove() +{ + systemctl daemon-reload } diff --git a/nexus.properties b/nexus.properties new file mode 100644 index 000000000000..bc6093305457 --- /dev/null +++ b/nexus.properties @@ -0,0 +1,29 @@ +# +# Sonatype Nexus (TM) Open Source Version +# Copyright (c) 2008-present Sonatype, Inc. +# All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. +# +# This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, +# which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. +# +# Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks +# of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the +# Eclipse Foundation. All other trademarks are the property of their respective owners. +# + +# Sonatype Nexus +# ============== +# This is the most basic configuration of Nexus. + +# Jetty section +application-port=8081 +application-host=0.0.0.0 +nexus-webapp=${bundleBasedir}/nexus +nexus-webapp-context-path=/ + +# Nexus section +nexus-work=/var/lib/nexus +runtime=${bundleBasedir}/nexus/WEB-INF + +# orientdb buffer size in megabytes +storage.diskCache.bufferSize=4096 diff --git a/nexus.service b/nexus.service index cfaf89008089..fd6ab9b97937 100644 --- a/nexus.service +++ b/nexus.service @@ -3,12 +3,14 @@ Description=Sonatype Nexus 2.x After=network.target [Service] -ExecStart=/opt/nexus/bin/nexus start -ExecStop=/opt/nexus/bin/nexus stop -ExecReload=/opt/nexus/bin/nexus restart -PIDFile=/opt/nexus/run/nexus.pid +Environment=PLEXUS_NEXUS_WORK=/var/lib/nexus +ExecStart=/usr/lib/nexus/bin/nexus start +ExecStop=/usr/lib/nexus/bin/nexus stop +ExecReload=/usr/lib/nexus/bin/nexus restart +PIDFile=/run/nexus/nexus.pid Type=forking User=nexus +Group=nexus [Install] WantedBy=multi-user.target diff --git a/nexus.sysusers b/nexus.sysusers new file mode 100644 index 000000000000..1329f67c6156 --- /dev/null +++ b/nexus.sysusers @@ -0,0 +1,2 @@ +u nexus - "Nexus OSS" /var/lib/nexus +g nexus - diff --git a/nexus.tmpfiles b/nexus.tmpfiles new file mode 100644 index 000000000000..784b6f00879e --- /dev/null +++ b/nexus.tmpfiles @@ -0,0 +1,5 @@ +d /var/log/nexus 0750 nexus nexus - +d /var/lib/nexus 0750 nexus nexus - +d /run/nexus 0750 nexus nexus - +z /usr/lib/nexus/conf/nexus.properties 0640 nexus nexus - +L+ /var/lib/nexus/logs - - - - /var/log/nexus |