This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

OpenRemote install

Jails with XigmaNAS
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
wirez05
Starter
Starter
Posts: 16
Joined: 02 Jun 2014 01:24
Status: Offline

OpenRemote install

Post by wirez05 »

Hey guys I have been lurking this site well before the split of nas4free and freenas. I like to take this opportunity to tank you all for being such a great informative community, this will be the first time after several years that I have started doing my own spin on the nasbox and will be putting together some instructional videos and how to provided we get this running. With the help of the forums I have been working on trying to consolidate my machines that are running within my home. that being said the Media server, Ftp, Cloud, SSH, and others are great and run perfectly, on the Net and Lan.

On to my next project - I am not sure if you guys have any interest but I have been doing a lot of research on Home automation and came across OpenRemote, i have also been doing alot of research in Arduio. I Have decided to set my Arduino Project aside for now in an effort to eliminate cost using zwave (wireless) technology. Unfortunately every time I try to start the Plug in it gives me a failed message.

My question is has anyone ever tried messing with this software? Its a security software that uses several protocols exp. zwave. It is also multi platform and should not be tough to implement unfortunately I keep running into issues and their forums are lacking in this area. It might be because I am trying to run it from Putty within a Jail but I am not sure. I should note that I am using the ReadyNas files that are Java Base programs and I am not sure if the Java Plugin i have installed is running within my OpenRemote Jail.

I am also open to differnt ideas if anyone has found an easier way to implement Home automation and Security software within controllers (within Jails) on the Nas4Free Box.

Currnetly Exploring :
http://www.openremote.org/display/HOME/OpenRemote

openRemote - Cross-platform:

Installs on Windows, Linux, Mac, Raspberry Pi, Alix, Synology, ReadyNAS, QNAP and others.

My NasBox:

9.2.0.1 - Shigawire (revision 972)
Build date Mon Apr 28 02:43:01 CEST 2014
Platform OS FreeBSD 9.2-RELEASE-p4 (kern.osreldate: 902001)
Platform x64-full on Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz
System Oracle Corporation VirtualBox
System bios innotek GmbH version: VirtualBox 12/01/2006

wirez05
Starter
Starter
Posts: 16
Joined: 02 Jun 2014 01:24
Status: Offline

Re: OpenRemote install

Post by wirez05 »

I have set up my ports reloaded the .sh and made a clean install. After making this file executable and running I get the following error.

"Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program"

Any advise on how to properly set up Java would be appreciated.

Thanks....

dreamcat4
experienced User
experienced User
Posts: 111
Joined: 21 Mar 2014 21:59
Status: Offline

Re: OpenRemote install

Post by dreamcat4 »

Maybe you can re-use the rc.d script from

/usr/ports/multimedia/universal-media-server/files/universal-media-server.in

Code: Select all

#!/bin/sh
#
# $FreeBSD$
# Created by: Dreamcat4 <dreamcat4@gmail.com>
#
# PROVIDE: universal_media_server
# REQUIRE: LOGIN DAEMON NETWORKING
# KEYWORD: shutdown
# 
# To enable Universal Media Server, just type:
# sysrc universal_media_server_enable=YES
# 
# Optional settings:
# universal_media_server_user=<run UMS program as 'user'>
# universal_media_server_profile_path=<full path to UMS profile directory, where exists UMS.conf, cache files, etc.>
# universal_media_server_log=<full path to UMS.log>
# universal_media_server_jvm_max_heap=<max memory usage - defaults to '768M'>
# universal_media_server_java_opts_extra="<extra java options>"
# 
# Advanced settings, better to leave alone:
# universal_media_server_java_class=<java main class to load (program entry point)>
# universal_media_server_path=<full path to the directory where ums is installed>
# universal_media_server_classpath=<colon-seperated list of all jar files to load, must include ums.jar)>
# universal_media_server_jvm_opts="<overides default jvm-related java options with your own set>"
# universal_media_server_java_opts="<overide default java options with your own set>"
#

. /etc/rc.subr

name=universal_media_server
rcvar=universal_media_server_enable
load_rc_config $name

: ${universal_media_server_enable:=NO}

# Optional settings
: ${universal_media_server_user=ums}
: ${universal_media_server_jvm_max_heap=768M}
: ${universal_media_server_profile_path=/var/db/universal-media-server}
: ${universal_media_server_log=/var/log/universal-media-server/UMS.log}

# Advanced settings, better to leave alone
: ${universal_media_server_path=/usr/local/share/java/universal-media-server}
: ${universal_media_server_java_class=net.pms.PMS}
: ${universal_media_server_classpath=ums.jar}
: ${universal_media_server_jvm_opts=-Xss2048k -XX:+UseParNewGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20}
: ${universal_media_server_java_opts=-Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Djna.nosys=true}
# End - "Advanced settings"

JAVA_HOME=/usr/local/openjdk7
JAVA=/usr/local/openjdk7/bin/java

pidfile=/var/run/universal-media-server/UMS.pid
start_precmd=${name}_prestart
start_postcmd=${name}_poststart
stop_precmd=${name}_prestop
stop_postcmd="rm ${pidfile}"

universal_media_server_prestart()
{
  if [ ! -e "${universal_media_server_profile_path}" ]; then
    mkdir -p ${universal_media_server_profile_path}
    cp "${universal_media_server_path}/UMS.conf" "${universal_media_server_profile_path}/UMS.conf.sample"
    cp "${universal_media_server_path}/WEB.conf" "${universal_media_server_profile_path}/WEB.conf.sample"
  fi

  # Make sure UMS has permission to write it's files into the profile directory
  chown -R ${universal_media_server_user}:${universal_media_server_user} ${universal_media_server_profile_path}
}

universal_media_server_poststart()
{
  # Find running UMS processes
  echo "$(pgrep -n -f "java.*${universal_media_server_classpath}.*${universal_media_server_java_class}")" > ${pidfile}
}

universal_media_server_prestop()
{
  ppid=$(head -1 ${pidfile})
  cpids=$(pgrep -d ' ' -P ${ppid})
  
  if [ "${cpids}" ]; then
    echo "Waiting for PIDS: ${cpids}"
    for signal in "TERM" "KILL" "HUP" "INT" "QUIT"       
    do
      pkill -${signal} -P ${ppid}
      cpids=$(pgrep -d ' ' -P ${ppid})
      [ "${cpids}" ] || break;
      sleep 1;
    done
  fi
}

_universal_media_server_java_args()
{
  echo \
  -Xmx${universal_media_server_jvm_max_heap} \
  ${universal_media_server_jvm_opts} \
  ${universal_media_server_java_opts} \
  ${universal_media_server_java_opts_extra} \
  -Dums.profile.path=${universal_media_server_profile_path} \
  -classpath ${universal_media_server_classpath} \
  ${universal_media_server_java_class}
}

# UMS looks for transcoder executables on $PATH, so PATH must include /usr/local/bin
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin

# UMS will only startup correctly when CWD=/path/to/ums, otherwise a bizarre exception occurs
universal_media_server_chdir=${universal_media_server_path}

command=${JAVA}
command_args="$(_universal_media_server_java_args) >> ${universal_media_server_log} 2>&1 &"

run_rc_command "$1"


mekonghigh
Starter
Starter
Posts: 39
Joined: 13 Oct 2013 18:03
Status: Offline

Re: OpenRemote install

Post by mekonghigh »

I have installed OpenRemote in Finch/Qjail, but i can not test if it work.

Create "OpenRemote" Folder in the Jail root and copy the contents of the OpenRemote download after uncompressing into the folder.

Code: Select all

pkg update -f
pkg install java/openjdk6
echo 'openremote_enable="YES"' >> /etc/rc.conf
cd /OpenRemote/bin
chmod +x openremote.sh
Create a openremote startup script.

Code: Select all

nano /usr/local/etc/rc.d/openremote 
Now copy the following into the file /usr/local/etc/rc.d/openremote

Code: Select all

#!/bin/sh 
# 
# 
# 
 
# PROVIDE: openremote 
# REQUIRE: LOGIN 
# KEYWORD: shutdown 
 
# 
# Add the following line to /etc/rc.conf to enable openremote 
# 
# openremote_enable="YES" 
#  
. /etc/rc.subr 
 
name=openremote 
rcvar=openremote_enable 
 
start_cmd="${name}_start" 
stop_cmd=":" 
 
openremote_start() 
{ 
 cd /OpenRemote/bin 
 ./openremote.sh start 
} 
 
load_rc_config ${name} 
 
export JAVA_HOME="/usr/local/openjdk6" 
 
run_rc_command "$1" 
Make openremote executable

Code: Select all

cd /usr/local/etc/rc.d
chmod +x openremote 
Don't know if it works but the output of "sh /usr/local/etc/rc.d/openremote start" is:

Code: Select all

openremote // root~# sh /usr/local/etc/rc.d/openremote start
Using CATALINA_BASE:   /OpenRemote
Using CATALINA_HOME:   /OpenRemote
Using CATALINA_TMPDIR: /OpenRemote/temp
Using JRE_HOME:       /usr/local/openjdk6 

wirez05
Starter
Starter
Posts: 16
Joined: 02 Jun 2014 01:24
Status: Offline

Re: OpenRemote install

Post by wirez05 »

PKG does not see to be a supported command

pkg: PACKAGESITE in pkg.conf is no longer supported. Convert to the new repository style. See pkg.conf(5)
pkg: Cannot parse configuration file!
Analysing shared libraries, this will take a while... pkg: PACKAGESITE in pkg.conf is no longer supported. Convert to the new repository style. See pkg.conf(5)
pkg: Cannot parse configuration file!

wirez05
Starter
Starter
Posts: 16
Joined: 02 Jun 2014 01:24
Status: Offline

Re: OpenRemote install

Post by wirez05 »

Got it, Figured it out open remote is configurable within a jail..... Setting up devices now. Will Post "How to" as i get the bugs worked out.

Post Reply

Return to “Jails”