From 2bac4ac1a7bd2580155dbac60a60044bfff186e2 Mon Sep 17 00:00:00 2001 From: Scott Serrano Date: Tue, 23 Feb 2016 22:22:15 -0800 Subject: [PATCH 1/4] Make the freenas init script executable --- init-scripts/init.freenas | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 init-scripts/init.freenas diff --git a/init-scripts/init.freenas b/init-scripts/init.freenas old mode 100644 new mode 100755 From 7cc58b84da07ebd0ceb5be7b1bd8d7eff7a991e8 Mon Sep 17 00:00:00 2001 From: Scott Serrano Date: Tue, 23 Feb 2016 22:25:08 -0800 Subject: [PATCH 2/4] Run plexpy directly in daemon mode instead of using the daemon program --- init-scripts/init.freenas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init-scripts/init.freenas b/init-scripts/init.freenas index e2946f2b..69360321 100755 --- a/init-scripts/init.freenas +++ b/init-scripts/init.freenas @@ -37,8 +37,8 @@ load_rc_config ${name} status_cmd="${name}_status" stop_cmd="${name}_stop" -command="/usr/sbin/daemon" -command_args="python2 ${plexpy_dir}/PlexPy.py --daemon --pidfile ${plexpy_pid} --quiet --nolaunch" +command="${plexpy_dir}/PlexPy.py" +command_args="--daemon --pidfile ${plexpy_pid} --quiet --nolaunch" # Ensure user is root when running this script. if [ `id -u` != "0" ]; then From 4c3a63a7e135efdde47cf7defb332ace2c4ce792 Mon Sep 17 00:00:00 2001 From: Scott Serrano Date: Tue, 23 Feb 2016 22:27:06 -0800 Subject: [PATCH 3/4] Allow for additional plexpy arguments like port --- init-scripts/init.freenas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init-scripts/init.freenas b/init-scripts/init.freenas index 69360321..54587aa8 100755 --- a/init-scripts/init.freenas +++ b/init-scripts/init.freenas @@ -33,12 +33,13 @@ load_rc_config ${name} : ${plexpy_dir:="/usr/local/share/plexpy"} : ${plexpy_chdir:="${plexpy_dir}"} : ${plexpy_pid:="${plexpy_dir}/plexpy.pid"} +: ${plexpy_flags:=""} status_cmd="${name}_status" stop_cmd="${name}_stop" command="${plexpy_dir}/PlexPy.py" -command_args="--daemon --pidfile ${plexpy_pid} --quiet --nolaunch" +command_args="--daemon --pidfile ${plexpy_pid} --quiet --nolaunch ${plexpy_flags}" # Ensure user is root when running this script. if [ `id -u` != "0" ]; then From daab1d917b08e1b1346ace030900e704909aea18 Mon Sep 17 00:00:00 2001 From: Scott Serrano Date: Sat, 5 Mar 2016 21:09:12 -0800 Subject: [PATCH 4/4] Update FreeBSD script to match the latest FreeNAS changes --- init-scripts/init.freebsd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init-scripts/init.freebsd b/init-scripts/init.freebsd index 3e3a9d90..b3a62fee 100755 --- a/init-scripts/init.freebsd +++ b/init-scripts/init.freebsd @@ -33,12 +33,13 @@ load_rc_config ${name} : ${plexpy_dir:="/usr/local/plexpy"} : ${plexpy_chdir:="${plexpy_dir}"} : ${plexpy_pid:="${plexpy_dir}/plexpy.pid"} +: ${plexpy_flags:=""} status_cmd="${name}_status" stop_cmd="${name}_stop" -command="/usr/sbin/daemon" -command_args="python2 ${plexpy_dir}/PlexPy.py --daemon --pidfile ${plexpy_pid} --quiet --nolaunch" +command="${plexpy_dir}/PlexPy.py" +command_args="--daemon --pidfile ${plexpy_pid} --quiet --nolaunch ${plexpy_flags}" # Ensure user is root when running this script. if [ `id -u` != "0" ]; then