Auto start jail and comands

Status
Not open for further replies.

Charlie86

Explorer
Joined
Sep 28, 2017
Messages
71
Hi,

After reboot I must manually start jail that I created. How can I configure it to start up automatically? Jail is created in Beta UI because it works only that way ( FreeBSD 11.1 )
Second jail is created in "regular UI" for qbittorrent and after every restart I must enter command in Jail shell "qbittorrent-nox --webui-port=12345" how can I set this to be done
automatically?

Thank you
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Second jail is created in "regular UI" for qbittorrent and after every restart I must enter command in Jail shell "qbittorrent-nox --webui-port=12345" how can I set this to be done
automatically?
You can set the web UI port in the settings in the web GUI for qbittorrent.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
setting <service>_enable=“YES” in rc.conf
...assuming there's an init script present, which there may or may not be depending on how the software was installed.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
There might not be, I had to move the one from my warden jail when I rebuilt it with iocage. If not I can provide the contents easily enough so it can be reproduced.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
I installed the package, not sure how @Charlie86 installed it.
 

Charlie86

Explorer
Joined
Sep 28, 2017
Messages
71
iocage set boot=yes jailname

That answer appears to be in this thread.

Hi,

I try to enable auto boot but after reboot, jail is still down until I power it up manualy.

This is how I did it


root@freenas:/mnt/pinja/Torrents # iocage set boot=yes Logitech

yes is not a valid value for boot.

Value must be off or on

root@freenas:/mnt/pinja/Torrents # iocage set boot=on Logitech

Property: boot has been updated to on


For qBittorrent autostart I created script


  1. Autostart qBittorrent
    You will now create a script file to autostart qBittorrent
    Credit to @joeschmuck for the autostart script. Thank you!
    Code:
    nano /etc/rc.d/qbit

    Copy and paste the following[/size]
    Code:
    #!/bin/sh
    # File name 'qbit'
    # Place this file into /etc/rc.d
    # Edit /etc/rc.conf to include qbit_enable="YES"

    . /etc/rc.subr

    name="qbit"
    rcvar=qbit_enable

    PATH="$PATH:/usr/local/bin"

    start_cmd="${name}_start"
    stop_cmd=":"

    load_rc_config $name
    eval "${rcvar}=\${${rcvar}:-'NO'}"

    qbit_start()
    {
    # And start up the service.

    su qbittorrent -c '/usr/local/bin/qbittorrent-nox -d'

    }

    run_rc_command "$1"


Do I need to do anything else, because I doesn't work ether :D


Why wouldn’t you install it from ports/pkg? https://svnweb.freebsd.org/ports/head/net-p2p/qbittorrent-nox11/

And if you didn’t, why wouldn’t you reinstall it from ports/pkg?

I install it from this thread

https://forums.freenas.org/index.php?threads/auto-start-jail-and-comands.64330/#post-460934

Is this OK?

To autostart services in a jail simply use the rc.d script by setting <service>_enable=“YES” in rc.conf https://www.freebsd.org/doc/handbook/configtuning-rcd.html

Sorry, I read doc twice and have no idea what should I do :).

Do I need to write qbittorrent-nox --webui-port=12345_enable=“YES” ? I am 99% this will not work.
 
Status
Not open for further replies.
Top