From Thursday, July, 9, 3:00 PM Pacific,
our Community site will be in
read-only mode
through Sunday, July 12th.
Thank you for your patience.

Nexus starts as root user but not as talenduser

Problem Description

You want to start Nexus as talenduser, but you can only start it as the root user. There are no error messages in the logs.

 

Root Cause

The cause is most likely an ownership issue. If the service starts as root user and not talenduser, there must be some files that are owned by root.

 

Solution

Change the ownership of the root user files, so you can start Nexus as talenduser:

  1. Edit the /tac/Artifact-Repository-Nexus-3.15.2-01-unix/nexus-3.15.2-01/bin Nexus startup file.
    case "$1" in
    start)
    echo "Starting nexus"
    
    $INSTALL4J_JAVA_PREFIX nohup "$app_java_home/bin/java" -server -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname" "-XX:+UnlockDiagnosticVMOptions" "-Dinstall4j.launcherId=245" "-Dinstall4j.swt=false" "$vmov_1" "$vmov_2" "$vmov_3" "$vmov_4" "$vmov_5" $INSTALL4J_ADD_VM_PARAMS -classpath "$local_classpath" com.install4j.runtime.launcher.UnixLauncher start 9d17dc87 "" "" org.sonatype.nexus.karaf.NexusMain > /dev/null 2>&1 &
    

    Configure it to generate startup messages that may contain clues, as shown below:

    case "$1" in
    start)
    echo "Starting nexus"
    
    $INSTALL4J_JAVA_PREFIX nohup "$app_java_home/bin/java" -server -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname" "-XX:+UnlockDiagnosticVMOptions" "-Dinstall4j.launcherId=245" "-Dinstall4j.swt=false" "$vmov_1" "$vmov_2" "$vmov_3" "$vmov_4" "$vmov_5" $INSTALL4J_ADD_VM_PARAMS -classpath "$local_classpath" com.install4j.runtime.launcher.UnixLauncher start 9d17dc87 "" "" org.sonatype.nexus.karaf.NexusMain

    Note: Depending on your installation the Nexus version might be different.

  2. Save the file.
  3. Start Nexus as talenduser to create a nohup.out file that contains startup messages.
  4. If the problem is an ownership issue, the nohup.out file displays messages similar to this:
    Could not delete id file /tmp/i4jdaemon__data_Artifact_Repository_Talend-AdministrationCenter-20190620_1446-V7.2.1_Artifact-Repository-Nexus-3.15.2-01-unix_nexus-3.15.2-01_bin_nexus. Aborting.
  5. Change the ownership of the files from root to talenduser, and start Nexus as talenduser.
Version history
Revision #:
11 of 11
Last update:
‎06-22-2020 10:47 AM
Updated by: