Pagina 1 di 1

Non riesco a far partire sul mio nuovo NAS DS920+ applicativo Java di nome Ubooquity

Inviato: giovedì 29 aprile 2021, 23:16
da Sergio_gal
A Java application named Ubooquity (which is used to view and organize comics and books) does not work on my new NAS DS920+ .
• I installed JAVA 8

• I have planned an activity activated with "user-defined script"

• I then activated it using the following ubooquity.sh script

Codice: Seleziona tutto

#!/usr/bin/env bash
#title           : ubooquity.sh
#description     : Launch ubooquity server. shell script in task manager
#date            : 2021 April
#==============================================================================
### JAVA VARIABLES ###
# Java installation directory
JAVA_DIR=/var/packages/Java8/target/j2sdk-image/jre
# Maximum size of the Java runtime memory allocation pool. Default: 64MB
MEM=512m
### UBOOQUITY VARIABLES ###
# Ubooquity binary location
UBOOQUITY_BIN=/var/packages/Ubooquity/Ubooquity.jar
# Ubooquity working directory
WORK_DIR=/volume1/Ubooquity
# Ubooquity process ID file location
PID_FILE=$WORK_DIR/ubooquity.pid
# Ubooquity library port
LIB_PORT=2202
# Ubooquity administration port
ADMIN_PORT=2203
### ENVIRONMENT VARIABLES ###
# Character encoding
ENCO=UTF-8
# Locale selection
LANG=en_US.$ENCO
### SCRIPT ###
# Workaround to read special characters properly
export LANG=en_US.$ENCO
# Kill previous process
if [ -f $PID_FILE ]; then
    pkill -F $PID_FILE > /dev/null 2>&1
fi
# Launch ubooquity
printf "Starting Ubooquity server...\n"
$JAVA_DIR/java -jar -Dfile.encoding=$ENCO -Xmx$MEM $UBOOQUITY_BIN \
               --adminport $ADMIN_PORT --libraryport $LIB_PORT \
               --workdir $WORK_DIR \
               --remoteadmin --headless & UBOOQUITY_PID=$!
echo $UBOOQUITY_PID > $PID_FILE
printf "Ubooquity is now running (pid: %d).\n" $UBOOQUITY_PID
exit 0
• I received the following error and the application does not start

/volume1/Ubooquity/ubooquity.sh: line 43: syntax error: unexpected end of file
I also replaced the following line in the script
JAVA_DIR=/var/packages/java/target/bin
But the error is till the same.
what's the mistake?

Re: Non riesco a far partire sul mio nuovo NAS DS920+ applicativo Java di nome Ubooquity

Inviato: sabato 1 maggio 2021, 16:16
da dMajo
I've edited your post by placing the script in the 'code' section. You need to use the '</>' button to encapsulate properly the code end preserve its correct spacing format and indentations.

You refer to an error at line 43 which doesn't exist since 'exit 0' (after copy&paste to notepad++) becomes line number 42. Obviously you have not posted correctly your code and/or you've done the same mistake with the script.
When you edit the scripts on your nas use eg notepad++ because the windows builtin notepad doesn't handle correctly line terminations. The NAS is running on linux OS.