This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
it will taken offline by the end of march 2021!
I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!
Autorun command when starting jail
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
I was wait, I wan'tе to put it on their own, but after writing the rc script, I realized that himbrr confused. Therefore, I advised to remove everything totally, and do it true.
but need also stop procedure for pyLoad - I wait Howto
but need also stop procedure for pyLoad - I wait Howto
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
-
fsbruva
- Advanced User

- Posts: 378
- Joined: 21 Sep 2012 14:50
- Status: Offline
Re: Autorun command when starting jail
jail_proto_exec_prestop=" ????? "
Like this?
Like this?
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
Yes. Jail need stop his processes, stop itself and only after this procedure nas4free host may continue shutdown.fsbruva wrote:jail_proto_exec_prestop=" ????? "
Like this?
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
Should I this to the rc.conf.local?alexey123 wrote:jail_proto_exec_prestop=" ????? "
Code: Select all
jail_proto_exec_prestop="/usr/local/bin/python /tmp/pyload/pyLoadCore.py -q"Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
Did I forgot something?
viewtopic.php?f=55&t=1598
viewtopic.php?f=55&t=1598
Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
alexey123
I tried the prestop command, but this wont work correctly.
Added the command:
You see, the jail is not starting.
I tried the prestop command, but this wont work correctly.
Added the command:
Code: Select all
nas4free:~#
nas4free:~# /etc/rc.d/jail stop
Stopping jails: proto.domain.local.
nas4free:~# /etc/rc.d/jail start
Configuring jails:.
Starting jails: proto.domain.local.
nas4free:~# jexec 29 pyLoadCore --status
jexec: jail_attach(29): Invalid argument
nas4free:~# jexec 30 pyLoadCore --status
jexec: jail_attach(30): Invalid argument
nas4free:~# jls
JID IP Address Hostname Path
Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
Behavior FreeBSD / Nas4Free when standup and shutdown you can find in your server - file /etc/default/rc.conf
System read this file and start services as wrote into - and check mask to /etc/rc.conf
Command need be some as written into this file. This is reference.
When system make shutdow procedure it execute /etc/rc.shutdown. This command read /etc/default/rc.conf in reverse order and stop services as it read.
Check section Jail on this large file - it have comments, maximum freebsd.org have manual pages. But please, do not rush.
For check shutdown and start procedures you need enable many logs - in first add to /etc/rc.conf both system, for nas4free over webgui
If you have embedded version - you need change /var/log location from ramdisk to hard disk. And I can not say for sure, I have read, if the system log is stored or cleaned in the process of rebooting.
Also useful to organize the log console
System read this file and start services as wrote into - and check mask to /etc/rc.conf
Command need be some as written into this file. This is reference.
When system make shutdow procedure it execute /etc/rc.shutdown. This command read /etc/default/rc.conf in reverse order and stop services as it read.
Check section Jail on this large file - it have comments, maximum freebsd.org have manual pages. But please, do not rush.
For check shutdown and start procedures you need enable many logs - in first add to /etc/rc.conf both system, for nas4free over webgui
Code: Select all
rc_debug="YES"
rc_info="YES"Also useful to organize the log console
Last edited by alexey123 on 01 Nov 2012 16:55, edited 1 time in total.
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
So I have to change /etc/default/rc.conf on the jail?alexey123 wrote: When system make shutdow procedure it execute /etc/rc.shutdown. This command read /etc/default/rc.conf in reverse order and stop services as wrote.
I don't understand.
Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
Oh.... I think it's yet working O.o
Code: Select all
nas4free:~# cat /etc/rc.conf.local
### EXAMPLE - MODIFY TO FIT YOUR NEEDS ###
jail_enable="YES" # enable jails YES|NO
jail_list="proto" # name of the jails to start "proto www..."
jail_proto_rootdir="/jail/proto" # path to our jail
jail_proto_hostname="proto.domain.local" # hostname
jail_proto_ip="192.168.22.11" # ip of the jail
jail_proto_interface="re0" # Network Interface to use, replace on your NAS interface name
jail_proto_devfs_enable="YES" # use devfs
jail_proto_mount_enable="YES" # mount YES|NO
jail_proto_fstab="/jail/conf/fstab.proto" # File with Filesystems to mount
jail_proto_exec_start="/usr/local/bin/python /usr/local/share/pyload/pyLoadCore.py --daemon"
jail_proto_exec_prestop="/usr/local/bin/python /usr/local/share/pyload/pyLoadCore.py -q"
Code: Select all
nas4free:~# /etc/rc.d/jail restart
Stopping jails: proto.domain.local.
Configuring jails:.
Starting jails:j proto.domain.local.
nas4free:~# jls
JID IP Address Hostname Path
32 192.168.22.11 proto.domain.local /jail/proto
nas4free:~# jexec 32 pyLoadCore --status
85378
Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
default/rc.conf is reference, not touch it.himbrr wrote:So I have to change /etc/default/rc.conf on the jail?alexey123 wrote: When system make shutdow procedure it execute /etc/rc.shutdown. This command read /etc/default/rc.conf in reverse order and stop services as wrote.
I don't understand.
If in default file wrote NO, but /etc/rc.conf wrote YES, system do as wrote into /etc/rc.conf.
May be need uncomment some strings
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
Try my /etc/rc.conf.local please.
Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
You can see on hardwork Daoyama. Now he upload system, which renewed on 30% codes from 9.1.0.1.394himbrr wrote:Oh.... I think it's yet working O.o
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
I can check only nightly - from my home.himbrr wrote:Try my /etc/rc.conf.local please.
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
I check.
Also my way is no good - need create user and group for pyload, create folder for user, give permissions and work over rc - scripts and jail's /etc/rc.conf. But I not programmer. I don't know write rc scripts. I make simple, as I know.
I put it into jail's /usr/local/etc folder
script /usr/local/etc/startall.sh
For add next software for jail - just add line for start added software
script /usr/local/etc/stopall.sh
Additional software need be added in first line
And into NAS4Free folder /etc/rc.conf.local I add line and edit jail_proto_exec_start= variable
As for me - work. I test any reboots with debug.
Also my way is no good - need create user and group for pyload, create folder for user, give permissions and work over rc - scripts and jail's /etc/rc.conf. But I not programmer. I don't know write rc scripts. I make simple, as I know.
I put it into jail's /usr/local/etc folder
script /usr/local/etc/startall.sh
Code: Select all
#!/bin/sh
/bin/sh /etc/rc
/usr/local/bin/python /tmp/pyload/pyLoadCore.py --daemonscript /usr/local/etc/stopall.sh
Code: Select all
#!/bin/sh
/usr/local/bin/python /tmp/pyload/pyLoadCore.py -q
jail_proto_exec_stop="/bin/sh /etc/rc.shutdown"And into NAS4Free folder /etc/rc.conf.local I add line and edit jail_proto_exec_start= variable
Code: Select all
jail_proto_exec_start="/bin/sh /usr/local/etc/startall.sh"
jail_proto_exec_stop="/bin/sh /usr/local/etc/stopall.sh"Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
Code: Select all
jail_proto_exec_prestop="/usr/local/bin/python /tmp/pyload/pyLoadCore.py -q"So you don't have to write a script. This should be easier for users.
Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
jail_proto_exec_prestop command I not find into /etc/default/rc.confhimbrr wrote:This don't work for you? On my machine this works perfectly.Code: Select all
jail_proto_exec_prestop="/usr/local/bin/python /tmp/pyload/pyLoadCore.py -q"
I make symple test. I enable debug into host and into jail, then make reboot for host.
After reboot I compare logs from nas4free and jail - what both devices do in time shutdown and startup. And compare times.
All users are villains who only want to break the system.So you don't have to write a script. This should be easier for users.
Also all building must be nice - in case nas4free:
- .pid file must be at /var/run/.
.log file must be as circular log at /var/log/. and have interface for view
installed extention must be have webpanel from webgui for manage. See my SnmpViewer. I can work without it, but now I hack device/windows more faster
But before do it, need create extension page for jail
yet let it work, I do not mind
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
The remote port 7227 is used by the android app.
For webgui you have to use port 8000.
If you want to use click'n'load on you local machine, you have to forward localhost:9666 to pyloadhost:9666.
Integration to the nas4free webgui would be nice, but I'm not a developer. Maybe another one could write the extension?
With phpmyadmin this was easy. Only link to www/phpmyadmin .. but create a link to the jail's ip and port 8000 is not so easy I think.
Would it be a good idea to create a route on nas4free for this three ports, to reach pyload over the nas4free ip?
192.168.22.9:8000 forward to 192.168.22.11:8000
remember I only installed pyload on jail, because I can't the required packages on nas4free host.
For webgui you have to use port 8000.
If you want to use click'n'load on you local machine, you have to forward localhost:9666 to pyloadhost:9666.
Integration to the nas4free webgui would be nice, but I'm not a developer. Maybe another one could write the extension?
With phpmyadmin this was easy. Only link to www/phpmyadmin .. but create a link to the jail's ip and port 8000 is not so easy I think.
Would it be a good idea to create a route on nas4free for this three ports, to reach pyload over the nas4free ip?
192.168.22.9:8000 forward to 192.168.22.11:8000
remember I only installed pyload on jail, because I can't the required packages on nas4free host.
Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2
-
fsbruva
- Advanced User

- Posts: 378
- Joined: 21 Sep 2012 14:50
- Status: Offline
Re: Autorun command when starting jail
The prestop and poststart commands can actuallybe prioritized to make life easier - jail_proto_exec_prestop{0,1,2}.alexey123 wrote: jail_proto_exec_prestop command I not find into /etc/default/rc.conf![]()
Excellent point!alexey123 wrote: All users are villains who only want to break the system.They dream to do so, even when sleeping
.
I am working on it!!!!alexey123 wrote: But before do it, need create extension page for jail
yet let it work, I do not mind
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
As for me - not working. May be I not with 2 left hands. My test. I create jailed /tmp/jail.log and add some lines to my shutdown script.fsbruva wrote:The prestop and poststart commands can actuallybe prioritized to make life easier - jail_proto_exec_prestop{0,1,2}.alexey123 wrote: jail_proto_exec_prestop command I not find into /etc/default/rc.conf![]()
Code: Select all
#!/bin/sh
date >> /tmp/jail.log
echo before_stop >> /tmp/jail.log
/usr/local/bin/python /tmp/pyload/pyLoadCore.py -q
date >> /tmp/jail.log
echo pyloadstoped_shutdown >> /tmp/jail.log
jail_proto_exec_stop="/bin/sh /etc/rc.shutdown"Code: Select all
nas# cat /jail/proto/tmp/jail.log
Fri Nov 2 22:01:34 IST 2012
before_stop
Fri Nov 2 22:01:34 IST 2012
pyloadstoped_shutdownCode: Select all
jail_proto_exec_prestop0="echo jail_prestoped >> /tmp/jail.log"Code: Select all
nas:~# /etc/rc.d/jail restart
Stopping jails:jail_prestoped >> /tmp/jail.log
proto.domain.local.
Configuring jails:.
Starting jails: proto.domain.local.
nas:~#Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
-
fsbruva
- Advanced User

- Posts: 378
- Joined: 21 Sep 2012 14:50
- Status: Offline
Re: Autorun command when starting jail
I re-read the documentation, and the prestop command is run OUTSIDE the jail. Furthermore, the jexec command AUTOMATICALLY re-pipes the output from the jexec'd command (echo, in your case, alexey) back to the standard output (console) of the HOST. Thus, it is impossible to get jexec 3 echo to be piped into a file by the jail. The echo would be carried out by the jail, but the redirection (>> or > or |) would be carried out by the host.
That being said, everything that follows the jid in the jexec call is passed to the jail as a command, and it is interpreted by the jail's shell. Still, however, jexec requires a jid, which is hard to know within the rc.conf.local file. My recommendation do what alexey suggested - create a custom shutdown script within the jail that stops the pyloader daemon, then executes the rc.shutdown script. However, an rc.d script wouldn't be a bad idea - with start, stop and restart functions. It can be created via the web gui once you get that going!
That being said, everything that follows the jid in the jexec call is passed to the jail as a command, and it is interpreted by the jail's shell. Still, however, jexec requires a jid, which is hard to know within the rc.conf.local file. My recommendation do what alexey suggested - create a custom shutdown script within the jail that stops the pyloader daemon, then executes the rc.shutdown script. However, an rc.d script wouldn't be a bad idea - with start, stop and restart functions. It can be created via the web gui once you get that going!
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
So, if I declare in rc.conf.local
and write into file , it will be work. Hmmmm, I think If you do all correctly, need to write rc-script with "start", "stop", "restart", "safestart" functions, create user "downloader", home folder for it, with permissions...
Code: Select all
jail_proto_exec_prestop0="/any_place/prestop.sh"Code: Select all
echo jail_prestoped >> /tmp/jail.logHome12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
-
fsbruva
- Advanced User

- Posts: 378
- Joined: 21 Sep 2012 14:50
- Status: Offline
Re: Autorun command when starting jail
Not really.... That line will have the same effect as doing this from the shell on the host:alexey123 wrote:So, if I declare in rc.conf.localCode: Select all
jail_proto_exec_prestop0="/any_place/prestop.sh"
Code: Select all
sh /jail/proto/any_place/prestop.shThe rc script would live in /jail/proto/etc/rc.d, and be named pyloader
Code: Select all
#!/bin/sh
# PROVIDE: pyloader
# REQUIRE: DAEMON cleanvar zfs
# KEYWORD: shutdown
. /etc/rc.subr
name="pyloader"
rcvar="pyloader_enable"
start_cmd="/usr/local/bin/python /tmp/pyload/pyLoadCore.py --daemon"
stop_cmd="/usr/local/bin/python /tmp/pyload/pyLoadCore.py -q"
load_rc_config $name
run_rc_command "$1"- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
# REQUIRE: DAEMON
Not be work. May be work # REQUIRE: LOGIN
Not be work. May be work # REQUIRE: LOGIN
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
-
fsbruva
- Advanced User

- Posts: 378
- Joined: 21 Sep 2012 14:50
- Status: Offline
Re: Autorun command when starting jail
Does that rc script work from the commandline, at least? I have a feeling his previous autostart problems were because DAEMON was misspelled as DEAMON.
- alexey123
- Moderator

- Posts: 1469
- Joined: 19 Aug 2012 08:22
- Location: Israel, Karmiel
- Contact:
- Status: Offline
Re: Autorun command when starting jail
Oups.fsbruva wrote:Does that rc script work from the commandline, at least? I have a feeling his previous autostart problems were because DAEMON was misspelled as DEAMON.
I absolutely do not care what will run any program, I just want to make a order.
If the program is described in the /etc/default/rc.conf then let rise as there is written, if undescribed - that after the run the main processes. And strictly in reverse order - shutting down processes.
In this case - I will repair my Minecraft Howto
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
alexey's script is working for me fine 
Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2
-
fsbruva
- Advanced User

- Posts: 378
- Joined: 21 Sep 2012 14:50
- Status: Offline
Re: Autorun command when starting jail
Which script? The shell?
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
Yes... the startall.sh and stopall.sh
Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2
-
himbrr
- Advanced User

- Posts: 153
- Joined: 21 Oct 2012 21:16
- Location: Germany
- Status: Offline
Re: Autorun command when starting jail
Extension menu entry:
Code: Select all
mkdir /usr/local/www/ext/pyload
echo '<a href="http://[youJailIP]:8000" target="_blank">pyLoad</a>' > /usr/local/www/ext/pyload/menu.inc
Nas4Free 9.2.0.1.972, ASUS P8H77-I, 8GB RAM, Intel Celeron CPU G530 @ 2.40GHz, 5x 2TB WD Red, 1x 60GB OCZ Vertex 2