docs
  • README
  • John's Notes and Documentation
    • Linux
      • Distributions
        • Arch Linux
          • Common Applications
          • Setting up pacaur with the Arch User Repository
          • Bluetooth
          • Hibernate
          • Graphical Configuration
          • libvirt
          • Post Install Tasks
            • Time
            • Reflector
            • SMTP
            • ZFS Configuration
            • smart
            • nfs
            • Package Management
              • aurutils
            • Programming Languages
              • nodejs
              • ruby
            • Restore Installed Applications
            • User Configuration Management
            • User Namespaces
            • Gaming with Wine
            • ZFS Dataset Structure
            • Raspberry PI Secure VPN Torrentbox
        • NixOS
          • Remotely Accessing Install Media
          • root on ZFS Install
      • systemd
        • Network Bonding
      • Tuning
        • CPU Tuning
        • Limits
        • Sysctls
        • Network Reliability With iwlwifi
        • Surface Pro 4 Power Tuning
        • ZFS Arc Max on Linux
      • TrueNAS
        • Setup
  • BSD
    • FreeBSD
      • iocage
      • Poudriere in a bhyve VM
    • FreeNAS
      • Copy SSH Keys off FreeNAS
      • FreeNAS Service jails
      • iocage Service jails
        • Couchpotato jail
        • Deluge jail
        • Emby jail
        • Poudriere WebUI jail
        • Podcatcher jail
        • Sabnzbd jail
        • Sickrage jail
        • Syncthing jail
        • Duplicity jail
        • Lets Encrypt jail
      • Wrong Version jail
    • pfSense
      • Sending Specific Traffic Through OpenVPN
  • Desktop and Userspace
    • Gaming
      • Grim Dawn
      • Path of Exile
    • Internet
      • Re-authenticate IRC Nickname
      • Lightdm VNC Connection with Password
    • Media
      • Convert Audio to Video
      • Convert Text to Speech
  • System Administration
    • Security
      • GPG Subkeys
    • Shell Scripting
      • dd
      • find
      • rsync
      • vim
    • ZFS
      • Mirrors
  • Certifications
    • CKA
      • Core-Concepts
      • Scheduling
      • Logging
      • Application Lifecycle Management
      • Cluster Maintenance
      • Security
      • Storage
      • Networking
      • Install Kubernetes with kubeadm
      • JSON PATH
Powered by GitBook
On this page
  • couchpotato jail
  • In Jail
  1. BSD
  2. FreeNAS
  3. iocage Service jails

Couchpotato jail

couchpotato jail

Setup for couchpotato service jail with iocage.

On FreeNAS

Create jail:

iocage create --release 11.1-RELEASE --name couchpotato \
          boot="on" vnet=on bpf=on \
          allow_raw_sockets="1" \
          ip4_addr="vnet1|172.20.40.31/24" \
          interfaces="vnet1:bridge1" \
          defaultrouter="172.20.40.1" \
          resolver="search ramsden.network;nameserver 172.20.40.1;nameserver 8.8.8.8"

On Freenas create datasets:

  • Datasets

    • Couchpotato Data

      • tank/data/database/couchpotato

    • Media

      • For all media tank/media/Movies/...

    • Downloads

      • For all Downloads tank/media/Downloads/...

Create media user/group using uid from freenas:

iocage exec couchpotato 'pw useradd -n media -u 8675309'

Nullfs mount datasets in jail:

Couchpotato data:

iocage exec couchpotato 'mkdir -p /var/db/couchpotato && chown media:media /var/db/couchpotato'
iocage fstab --add couchpotato '/mnt/tank/data/database/couchpotato /var/db/couchpotato nullfs rw 0 0'

Downloads:

iocage exec couchpotato 'mkdir -p /media/Downloads/Complete /media/Downloads/Incomplete && chown -R media:media /media/Downloads'

iocage fstab --add couchpotato '/mnt/tank/media/Downloads/Complete /media/Downloads/Complete nullfs rw 0 0' && \
iocage fstab --add couchpotato '/mnt/tank/media/Downloads/Incomplete /media/Downloads/Incomplete nullfs rw 0 0'

Setup directories:

iocage exec couchpotato 'mkdir -p /media/Movie/Movies /media/Movie/Sports && chown -R media:media /media'

Repeat for media:

iocage fstab --add couchpotato '/mnt/tank/media/Movie/Movies /media/Movie/Movies nullfs rw 0 0' && \
iocage fstab --add couchpotato '/mnt/tank/media/Movie/Sports /media/Movie/Sports nullfs rw 0 0'

Check fstab:

iocage fstab --list couchpotato

Start jail and enter.

iocage console couchpotato

In Jail

pkg update && pkg upgrade

Install required tools

pkg install python py27-sqlite3 fpc-libcurl docbook-xml git-lite

Use user media, clone to a temp repo in /var/db.

cd /var/db
git clone https://github.com/CouchPotato/CouchPotatoServer.git temp

Move the bare repo that was just cloned to the dataset we mounted earlier to /var/db/couchpotato.

mv temp/.git couchpotato/
rm -rf temp

Switch to the media user and reset the repo to HEAD.

su media
cd couchpotato
git reset --hard HEAD
exit

As root, copy the startup script to /usr/local/etc/rc.d and make the startup script executable.

mkdir /usr/local/etc/rc.d
cp /var/db/couchpotato/init/freebsd /usr/local/etc/rc.d/couchpotato
chmod 555 /usr/local/etc/rc.d/couchpotato

Read the options at the top of /usr/local/etc/rc.d/couchpotato.

If not using the default install, specify options with startup flags.

sysrc 'couchpotato_enable=YES' 'couchpotato_user=media' 'couchpotato_dir=/var/db/couchpotato'

Finally, start couchpotato.

service couchpotato start
Previousiocage Service jailsNextDeluge jail

Last updated 5 months ago

Install freebsd version from git.

Restart the jail, open your browser and go to .

couchpotato
http://server:5050/