As I convert over my plugins, I'm looking to see if anyone has cli instructions for installing resilio sync(btsync) with iocage
I've tried to piece together some instructions myself but I don't really know what I'm doing and the jail crashed and burned. I think a lot of the errors have come up because of the change of name from btsync to rslsync.
I've tried to piece together some instructions myself but I don't really know what I'm doing and the jail crashed and burned. I think a lot of the errors have come up because of the change of name from btsync to rslsync.
# make temp file that will cause iocage to install some packages
echo '{"pkgs":["ca_root_nss"]}' > /tmp/pkg.json
# create jail
iocage create -n "btsync" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|[btsync IP]/24" defaultrouter="[router ip]" vnet="on" allow_raw_sockets="1" boot="on"
# remove the temp file
rm /tmp/pkg.json
# map config and data storage outside of jail
iocage fstab -a btsync /mnt/[zpool]/[data directory on server] /mnt/btsyncdata nullfs rw 0 0
iocage fstab -a btsync /mnt/[zpool]/[config directory on server] /config nullfs rw 0 0
# link python
iocage exec btsync ln -s /usr/local/bin/python2.7 /usr/bin/python
iocage exec btsync ln -s /usr/local/bin/python2.7 /usr/bin/python2
# download and unpack resilio from website
iocage exec btsync mkdir /usr/local/btsync
iocage exec btsync "fetch https://download-cdn.resilio.com/stable/FreeBSD-x64/resilio-sync_freebsd_x64.tar.gz -o /usr/local/btsync/"
iocage exec btsync "tar -xzvf /usr/local/btsync/resilio-sync_freebsd_x64.tar.gz -C /usr/local/btsync/"
iocage exec btsync rm /usr/local/btsync/resilio-sync_freebsd_x64.tar.gz
# add btsync user using pid:uid used by btsync in the past
iocage exec btsync "pw user add btsync -c btsync -u 817 -d /nonexistent -s /usr/bin/nologin"
# change ownership of config and data directories
iocage exec btsync chown -R btsync:btsync /mnt/btsyncdata /config
# Link the btsync config file to one from config directory outside of jail
iocage exec btsync ln -s /config/btsync.conf /usr/local/etc/btsync.conf
# create the run command directory and file
iocage exec btsync mkdir /usr/local/etc/rc.d
ee /mnt/iocage/jails/btsync/root/usr/local/etc/rc.d/rslsync
#!/bin/sh
#
# PROVIDE: btsync
# REQUIRE: LOGIN DAEMON NETWORKING
# KEYWORD: shutdown
#
# To enable BTSync, add this line to your /etc/rc.conf:
#
# btsync_enable="YES"
#
# And optionally these line:
#
# btsync_user="username" # Default is "root"
# btsync_bin="/path/to/btsync" # Default is "/usr/local/sbin/btsync"
. /etc/rc.subr
name="btsync"
rcvar="btsync_enable"
load_rc_config $name
required_files=$btsync_bin
: ${btsync_enable="NO"}
: ${btsync_user="btsync"}
: ${btsync_bin="/usr/local/sbin/btsync"}
: ${btsync_config="/usr/local/btsync/btsync.conf"}
command=$btsync_bin
command_args="--config ${btsync_config}"
run_rc_command "$1"
#move the executable from btsync to sbin
iocage exec btsync mv /usr/local/btsync/rslsync /usr/local/sbin/
# make the run command file executable
iocage exec btsync chmod u+x /usr/local/etc/rc.d/rslsync
#enable start up of btsync and start
iocage exec btsync sysrc "btsync_enable=YES"
iocage exec btsync service btsync start