0
Answered

Ubooquity Synology Set up Problem

Laxarus 1 month ago • updated by Tom 1 month ago 4

Hello guys,

I've been trying to set up Ubooquity with my Synology but with no luck. I am using "User Defined Script" for DSM 6 with Java 8. I am getting error "/usr/bin/env: bash: No such file or directory". I have tried everything but st,

My current ubooquity.sh is below:

#!/usr/bin/env bash
#title : ubooquity.sh
#description : Launch ubooquity server. shell script in task manager
#date : 20170807
#==============================================================================
### JAVA VARIABLES ###
# Java installation directory
JAVA_DIR=/var/packages/java8/target/j2sdk-image/jre/bin
# Maximum size of the Java runtime memory allocation pool. Default: 64MB
MEM=512m
### UBOOQUITY VARIABLES ###
# Ubooquity binary location
UBOOQUITY_BIN=/volume1/Internal/Ubooquity/Ubooquity.jar
# Ubooquity working directory
WORK_DIR=/volume1/Gulibu/
# 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
# 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

+1

Okay, fixed the problem.

For those who are having the same problem.

Open ubooquity.sh with notebook++

edit

EOL Conversion

Select Linux

Additionally, JAVA_DIR is case sensitive for some reason. java8 to Java8

it is now running.

Under review

Thanks for the feedback.

I have updated the ubooquity.sh file on the webiste (line separators were CRLF instead of LF), no point in having a bash script with Windows line separators.

Here is mine, on Syno DS216play:

echo "Ubooquity task manager script"
#nom du fichier enregistrant le pid de ubooquity au lancement
PID_FILE=/volume1/docs/e-book/Ubooquity/ubooquity.pid
# installation settings
JAVA_BIN=/var/packages/Java8/target/j2sdk-image/bin/java
PCKG_BIN=/volume1/docs/e-book/Ubooquity/Ubooquity.jar
WORK_DIR=/volume1/docs/e-book/Ubooquity/
# app settings
PORT=2202
ADMINPORT=2203
MEM=512m
# This ensures that ubooquity reads special characters properly
#export LC_ALL=fr_FR.utf8
export LANG=fr_FR.utf8
#Command line for launching ubooquity
echo "Starting the Ubooquity server"
$JAVA_BIN -Xmx$MEM -jar $PCKG_BIN --adminport $ADMINPORT --libraryport $PORT --workdir $WORK_DIR --remoteadmin --headless & UBOOQUITY_PID=$!
echo $UBOOQUITY_PID > $PID_FILE
echo "The server has been started with pid $UBOOQUITY_PID ."
exit 0