Hi,
First, i do know very little about Linux, FreeBSD, FreeNAS or Domoticz. I was guided a very lot when i made my system setup.
Now I have Domoticz with Open Z-wave in IOCAGE jai in FreeNAS 11.1-U1. Everything is working just fine. All installation guides seems to be some how imperfect and there was also a spelling mistakes in the 'domoticz_stop' section. In WARDEN jail i got several problem with linking USB to the jail, etc the symbolic link disappeared when booting. If you use Open Z-wave the symbolic link must be done in each start up, at least it was like that way in my WARDEN jail Domoticz. Now my Domiticz is in the IOCAGE jail. My home automation setup is in a building and testig phase and i am learning how to do things - in very slow way. Now 1 am working with Motion service to add ip camera to the setup. Anyway, in warden jail, my autostart problem was solved like it is here + post init scrip which makes symbolic link to the jail in each startup.
/etc/rc.conf
Code: Select all
hostname="domoticz"
devfs_enable="YES"
devfs_system_ruleset="devfsrules_common"
domoticz_enable="YES"
/usr/local/etc/rc.d/domoticz
EDIT: this is based the file i found from FreeNAS forum. I have made only a error fix missin '}'. Later i have made some changes etc. db dir outside from the jail and user&group as domoticz.
Code: Select all
. /etc/rc.subr
name="domoticz"
rcvar="domoticz_enable"
stop_cmd="${name}_stop"
load_rc_config $name
: ${domoticz_dbdir:=/home/domoticz/domoticz}
: ${domoticz_user:=root}
: ${domoticz_group:=wheel}
: ${domoticz_enable:=NO}
: ${domoticz_directory:="/home/domoticz/domoticz/"}
: ${domoticz_args:="-syslog -daemon"}
#: ${domoticz_args:="-syslog -dbase /home/domoticz/domoticz/domoticz.db -daemon -wwwbind 0.0.0.0 -p /var/run/domoticz_1.pid"}
pidfile=${domoticz_pidfile:="/var/run/${hostname}.pid"}
command="/home/domoticz/domoticz/domoticz"
command_args="-dbase ${domoticz_dbdir}/domoticz.db -pidfile ${pidfile} ${domoticz_args}"
domoticz_stop() {
if [ -e "${pidfile}" ]; then
echo "Stopping ${name}..."
kill -9 `cat ${pidfile}`
rm ${pidfile}
fi
}
run_rc_command "$1"