Joshua Parker Ruehlig
Hall of Famer
- Joined
- Dec 5, 2011
- Messages
- 5,949
you added a new line in the command_args
@Musabi It looks like you got pretty close to getting it working!
Here's a few issues I see, and also some minor suggestions
* you install 'wget', this really isn't needed, just use 'fetch' to download the binary
* you put the jackett files in /usr/local/bin while the rc.d script you use expects the Jackett files to be in /opt. personally, I think these should be somewhere like /usr/local/share/Jackett
* you could just run 'sysrc jackett_enable=YES' to avoid manually editting /etc/rc.conf
* you should not put user created rc.d scripts in /etc/rc.d, these should be in /usr/local/etc/rc.d
* running as media user could not be working because of permissions (the user running should own /var/db/jackett). But I assume in your case, you never created the media user in your jail
* a jail on FreeNAS is not "linux based" and uses linux in no way =P
Here's what I just tried and it worked as expected
Code:pkg install mono curl fetch https://github.com/Jackett/Jackett/releases/download/v0.7.363/Jackett.Binaries.Mono.tar.gz tar xzf Jackett.Binaries.Mono.tar.gz mv Jackett /usr/local/share rm Jackett.Binaries.Mono.tar.gz sysrc jackett_enable=YES
Create /usr/local/etc/rc.d/jackett
Code:#!/bin/sh # # $FreeBSD$ # # PROVIDE: jackett # REQUIRE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable jackett: # jackett_enable="YES" . /etc/rc.subr name="jackett" rcvar=jackett_enable load_rc_config $name : ${jackett_enable="NO"} : ${jackett_user:="root"} : ${jackett_data_dir:="/var/db/jackett"} procname="/usr/local/bin/mono" command="/usr/sbin/daemon" command_args="-f ${procname} /usr/local/share/Jackett/JackettConsole.exe -d ${jackett_data_dir}" start_precmd="export XDG_CONFIG_HOME=${jackett_data_dir}" run_rc_command "$1"
Code:chmod +x /usr/local/etc/rc.d/jackett service jackett strart
04-20 10:57:13 Error Exception in Configure System.Exception: Found no results w hile trying to browse this tracker at Jackett.Services.IndexerManagerService+<TestIndexer>c__async0.MoveNext () [ 0x000fa] in <14a3554ace014df2b21ece1781b08657>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] i n <8f2c484307284b51944a1a13a14c0266>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Thre ading.Tasks.Task task) [0x0004e] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNoti fication (System.Threading.Tasks.Task task) [0x0002e] in <8f2c484307284b51944a1a 13a14c0266>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.T asks.Task task) [0x0000b] in <8f2c484307284b51944a1a13a14c0266>:0 at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <8f2c 484307284b51944a1a13a14c0266>:0 at Jackett.Controllers.AdminController+<Configure>c__async4.MoveNext () [0x001 e4] in <14a3554ace014df2b21ece1781b08657>:0
@Musabi It looks like you got pretty close to getting it working!
Here's a few issues I see, and also some minor suggestions
* you install 'wget', this really isn't needed, just use 'fetch' to download the binary
* you put the jackett files in /usr/local/bin while the rc.d script you use expects the Jackett files to be in /opt. personally, I think these should be somewhere like /usr/local/share/Jackett
* you could just run 'sysrc jackett_enable=YES' to avoid manually editting /etc/rc.conf
* you should not put user created rc.d scripts in /etc/rc.d, these should be in /usr/local/etc/rc.d
* running as media user could not be working because of permissions (the user running should own /var/db/jackett). But I assume in your case, you never created the media user in your jail
* a jail on FreeNAS is not "linux based" and uses linux in no way =P
Here's what I just tried and it worked as expected
Code:pkg install mono curl fetch https://github.com/Jackett/Jackett/releases/download/v0.7.363/Jackett.Binaries.Mono.tar.gz tar xzf Jackett.Binaries.Mono.tar.gz mv Jackett /usr/local/share rm Jackett.Binaries.Mono.tar.gz sysrc jackett_enable=YES
Create /usr/local/etc/rc.d/jackett
Code:#!/bin/sh # # $FreeBSD$ # # PROVIDE: jackett # REQUIRE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable jackett: # jackett_enable="YES" . /etc/rc.subr name="jackett" rcvar=jackett_enable load_rc_config $name : ${jackett_enable="NO"} : ${jackett_user:="root"} : ${jackett_data_dir:="/var/db/jackett"} procname="/usr/local/bin/mono" command="/usr/sbin/daemon" command_args="-f ${procname} /usr/local/share/Jackett/JackettConsole.exe -d ${jackett_data_dir}" start_precmd="export XDG_CONFIG_HOME=${jackett_data_dir}" run_rc_command "$1"
Code:chmod +x /usr/local/etc/rc.d/jackett service jackett strart
pkg install mono curl fetch https://github.com/Jackett/Jackett/releases/download/v0.7.1377/Jackett.Binaries.Mono.tar.gz tar xzf Jackett.Binaries.Mono.tar.gz mv Jackett /usr/local/share rm Jackett.Binaries.Mono.tar.gz sysrc jackett_enable=YES
mkdir /usr/local/etc/rc.d/jackett
ee /usr/local/etc/rc.d/jackett.sh
#!/bin/sh # # $FreeBSD$ # # PROVIDE: jackett # REQUIRE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable jackett: # jackett_enable="YES" . /etc/rc.subr name="jackett" rcvar=jackett_enable load_rc_config $name : ${jackett_enable="NO"} : ${jackett_user:="root"} : ${jackett_data_dir:="/var/db/jackett"} procname="/usr/local/bin/mono" command="/usr/sbin/daemon" command_args="-f ${procname} /usr/local/share/Jackett/JackettConsole.exe -d ${jackett_data_dir}" start_precmd="export XDG_CONFIG_HOME=${jackett_data_dir}" run_rc_command "$1"
chmod +x /usr/local/etc/rc.d/jackett service jackett strart
mkdir /usr/local/etc/rc.d/jackett
Thecommand is unnecessary. You should only have your rc file(s) in /usr/local/etc/rc.d not a directories. Your rc file should be named /usr/local/etc/rc.d/jackett note the absence of .sh from the end of the filename.Code:mkdir /usr/local/etc/rc.d/jackett
su: pam_start: system error /usr/local/etc/rc.d/jackett: WARNING: failed to start jackett
#!/bin/sh # # $FreeBSD$ # # PROVIDE: jackett # REQUIRE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable jackett: # jackett_enable="YES" . /etc/rc.subr name="jackett" rcvar=jackett_enable load_rc_config $name : ${jackett_enable="NO"} : ${jackett_user:="media"} : ${jackett_data_dir:="/var/db/jackett"} procname="/usr/local/bin/mono" command="/usr/sbin/daemon" command_args="-f ${procname} /opt/Jackett/JackettConsole.exe -d ${jackett_data_dir}" start_precmd=jackett_precmd jackett_precmd() { export XDG_CONFIG_HOME=${jackett_data_dir} if [ ! -d ${jackett_data_dir} ]; then install -d -o ${jackett_user} ${jackett_data_dir} fi } run_rc_command "$1"
ls -l /var/db/jackett/ total 182 drwxr-xr-x 2 media media 17 May 4 16:46 Indexers -rwxr-xr-x 1 media media 439 Jan 10 21:54 ServerConfig.json -rwxr-xr-x 1 media media 289020 May 10 23:22 log.txt -rwxr-xr-x 1 media media 422077 Apr 24 15:36 updater.txt ls -l /opt/jackett/ total 4924 -rwxr-xr-x 1 media media 1223680 Apr 24 15:36 AngleSharp.dll -rwxr-xr-x 1 media media 273408 Apr 24 15:36 AutoMapper.dll -rwxr-xr-x 1 media media 16896 Apr 24 15:36 Autofac.Integration.Owin.dll -rwxr-xr-x 1 media media 7680 Apr 24 15:36 Autofac.Integration.WebApi.Owin.dll -rwxr-xr-x 1 media media 45568 Apr 24 15:36 Autofac.Integration.WebApi.dll -rwxr-xr-x 1 media media 212480 Apr 24 15:36 Autofac.dll -rwxr-xr-x 1 media media 19968 Apr 24 15:36 CloudFlareUtilities.dll -rwxr-xr-x 1 media media 58368 Apr 24 15:36 CommandLine.dll drwxr-xr-x 7 media media 20 Mar 8 12:49 Content -rwxr-xr-x 1 media media 815104 Apr 24 15:36 CsQuery.dll -rwxr-xr-x 1 media media 53248 Apr 24 15:36 CurlSharp.dll -rwxr-xr-x 1 media media 338 Apr 24 15:36 CurlSharp.dll.config -rwxr-xr-x 1 media media 19634 Apr 24 15:36 CurlSharp.dll.mdb -rwxr-xr-x 1 media media 12288 Apr 24 15:36 DateTimeRoutines.dll drwxr-xr-x 2 media media 121 Apr 12 16:51 Definitions -rwxr-xr-x 1 media media 200704 Apr 24 15:36 ICSharpCode.SharpZipLib.dll -rwxr-xr-x 1 media media 1099264 Apr 24 15:36 Jackett.dll -rwxr-xr-x 1 media media 204197 Apr 24 15:36 Jackett.dll.mdb -rwxr-xr-x 1 media media 13824 Apr 24 15:36 JackettConsole.exe -rwxr-xr-x 1 media media 2456 Apr 24 15:36 JackettConsole.exe.config -rwxr-xr-x 1 media media 2453 Apr 24 15:36 JackettConsole.exe.mdb -rwxr-xr-x 1 media media 4608 Apr 24 15:36 JackettService.exe -rwxr-xr-x 1 media media 2222 Apr 24 15:36 JackettService.exe.config -rwxr-xr-x 1 media media 941 Apr 24 15:36 JackettService.exe.mdb -rwxr-xr-x 1 media media 753152 Apr 24 15:36 JackettTray.exe -rwxr-xr-x 1 media media 2456 Apr 24 15:36 JackettTray.exe.config -rwxr-xr-x 1 media media 2002 Apr 24 15:36 JackettTray.exe.mdb -rwxr-xr-x 1 media media 11264 Apr 24 15:36 JackettUpdater.exe -rwxr-xr-x 1 media media 2222 Apr 24 15:36 JackettUpdater.exe.config -rwxr-xr-x 1 media media 2113 Apr 24 15:36 JackettUpdater.exe.mdb -rwxr-xr-x 1 media media 18047 Apr 24 15:36 LICENSE -rwxr-xr-x 1 media media 171672 Apr 24 15:36 Microsoft.AspNet.Identity.Core.dll -rwxr-xr-x 1 media media 18088 Apr 24 15:36 Microsoft.Owin.FileSystems.dll -rwxr-xr-x 1 media media 88232 Apr 24 15:36 Microsoft.Owin.Host.HttpListener.dll -rwxr-xr-x 1 media media 133288 Apr 24 15:36 Microsoft.Owin.Host.SystemWeb.dll -rwxr-xr-x 1 media media 64680 Apr 24 15:36 Microsoft.Owin.Hosting.dll -rwxr-xr-x 1 media media 64680 Apr 24 15:36 Microsoft.Owin.StaticFiles.dll -rwxr-xr-x 1 media media 101032 Apr 24 15:36 Microsoft.Owin.dll -rwxr-xr-x 1 media media 348160 Apr 24 15:36 MonoTorrent.dll -rwxr-xr-x 1 media media 488960 Apr 24 15:36 NLog.dll -rwxr-xr-x 1 media media 658944 Apr 24 15:36 Newtonsoft.Json.dll -rwxr-xr-x 1 media media 4608 Apr 24 15:36 Owin.dll -rwxr-xr-x 1 media media 10205 Apr 24 15:36 README.md -rwxr-xr-x 1 media media 22232 Apr 24 15:36 System.Net.Http.Extensions.dll -rwxr-xr-x 1 media media 185544 Apr 24 15:36 System.Net.Http.Formatting.dll -rwxr-xr-x 1 media media 21720 Apr 24 15:36 System.Net.Http.Primitives.dll -rwxr-xr-x 1 media media 62152 Apr 24 15:36 System.Web.Http.Owin.dll -rwxr-xr-x 1 media media 29384 Apr 24 15:36 System.Web.Http.Tracing.dll -rwxr-xr-x 1 media media 471240 Apr 24 15:36 System.Web.Http.dll -rwxr-xr-x 1 media media 627 Apr 24 15:36 Upstart.config -rwxr-xr-x 1 media media 181248 Apr 24 15:36 YamlDotNet.dll -rwxr-xr-x 1 media media 499977 Apr 23 15:28 log.20170423.00333.txt -rwxr-xr-x 1 media media 499921 Apr 23 15:30 log.20170423.00334.txt -rwxr-xr-x 1 media media 499998 Apr 23 15:33 log.20170423.00335.txt -rwxr-xr-x 1 media media 495796 Apr 23 18:02 log.20170423.00336.txt -rwxr-xr-x 1 media media 499951 Apr 30 05:16 log.20170430.00000.txt
portmap_enable="NO" sshd_enable="YES" sendmail_enable="NO" sendmail_submit_enable="NO" sendmail_outbound_enable="NO" sendmail_msp_queue_enable="NO" hostname="jackett" devfs_enable="YES" devfs_system_ruleset="devfsrules_common" inet6_enable="YES" jackett_enable="YES" ip6addrctl_enable="YES"
root@Jackett:/ # service jackett start Starting jackett. login class 'daemon' non-existent, using default root@Jackett:/ # service jackett status jackett is not running. root@Jackett:/ #
#!/bin/sh # # $FreeBSD$ # # PROVIDE: jackett # REQUIRE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable jackett: # jackett_enable="YES" . /etc/rc.subr name="jackett" rcvar=jackett_enable load_rc_config $name start_postcmd="${name}_poststart" stop_postcmd="${name}_poststop" : ${jackett_enable="NO"} : ${jackett_user:="root"} : ${jackett_data_dir:="/var/db/jackett"} pidfile="${jackett_data_dir}/jackett.pid" procname="/usr/local/bin/mono" command="/usr/sbin/daemon" command_args="-f ${procname} /usr/local/Jackett/JackettConsole.exe -d ${jackett_data_dir}" start_precmd="export XDG_CONFIG_HOME=${jackett_data_dir}" jackett_poststart() { echo `ps ax | grep "JackettConsole.exe" | grep -v grep | awk '{print $1}'` > $pidfile } jackett_poststop() { rm $pidfile } run_rc_command "$1"
maybe you could try letting daemon do this for you?I've ran into an issue with the scripts that are included in this posting. If you have multiple services running (radarr / sonarr) and jackett installed at the same time and you issue a "service jackett stop" it will stop the other processes as well and not just itself.
EDIT
I fixed this by adding a poststart_cmd to find the PID of JackettConsole.exe and then writing that to my pidfile varible which avoids the problem above.
Code:#!/bin/sh # # $FreeBSD$ # # PROVIDE: jackett # REQUIRE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable jackett: # jackett_enable="YES" . /etc/rc.subr name="jackett" rcvar=jackett_enable load_rc_config $name start_postcmd="${name}_poststart" stop_postcmd="${name}_poststop" : ${jackett_enable="NO"} : ${jackett_user:="root"} : ${jackett_data_dir:="/var/db/jackett"} pidfile="${jackett_data_dir}/jackett.pid" procname="/usr/local/bin/mono" command="/usr/sbin/daemon" command_args="-f ${procname} /usr/local/Jackett/JackettConsole.exe -d ${jackett_data_dir}" start_precmd="export XDG_CONFIG_HOME=${jackett_data_dir}" jackett_poststart() { echo `ps ax | grep "JackettConsole.exe" | grep -v grep | awk '{print $1}'` > $pidfile } jackett_poststop() { rm $pidfile } run_rc_command "$1"
maybe you could try letting daemon do this for you?
command_args="-f -p ${pidfile} ${procname} /usr/local/Jackett/JackettConsole.exe -d ${jackett_data_dir}"