Is it true that each line of post_install.sh is executed in parallel?

fuji44

Cadet
Joined
Nov 12, 2019
Messages
3
Hello everyone.

This is my first time posting. I've read the rules, but if there's anything I've done that violates the rules, please point it out.

I've recently been learning how to create a plugin for iocage. I was able to create a plugin by looking at some documents, but I found a description in the official documentation that caught my attention.

Note that iocage executes the file contents simultaneously, not line by line.

Is this true?
> Note that iocage executes the file contents simultaneously, not line by line. If this is true, is it better to use `&&` for commands where the order of execution is important?
If so, it makes the script quite difficult to read.

To give you some background, I'm trying to install some additional software in this script, and I want to remove some concerns because I need to run some commands like git and pip sequentially.

If you have any good documentation on creating plugins, I would appreciate it.

By the way, I am testing with TrueNAS core 12.-U3.1.
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
I've been maintaining some iocage plugins (using CLI) since FreeNAS 11.2 and I've never seen that before -- I could still be wrong, but from my own experience it appears post_install.sh (and pre_update.sh / post_update.sh) runs line by line.
 

fuji44

Cadet
Joined
Nov 12, 2019
Messages
3
I've been maintaining some iocage plugins (using CLI) since FreeNAS 11.2 and I've never seen that before -- I could still be wrong, but from my own experience it appears post_install.sh (and pre_update.sh / post_update.sh) runs line by line.

Thank you for your answer. I hope the execution order can be guaranteed.

This may not be relevant, but it seems that the same message may be output multiple times during installation. This and the documentation made me nervous.

Just this morning, I saw your repository and found out that post_update.sh works. Thanks for that. This is a bit off topic, but how did you find out about post_update.sh?
Did you look at the source code of iocage?
 

tprelog

Patron
Joined
Mar 2, 2016
Messages
297
This may not be relevant, but it seems that the same message may be output multiple times during installation.

I see the same thing. It's annoying, but so far does not appear to caused any issues

how did you find out about post_update.sh

I happen to notice them while updating a plugin from the console. You may see the following lines in the example below
- Running pre_update.sh script
- Running post_update.sh script

Code:
truenas-vm% sudo iocage update test
Snapshot: tank/iocage/jails/test@ioc_update_12.2-RELEASE-p6_2021-05-10_13-43-44 created.
Updating plugin...
Snapshotting test...
Updating plugin INDEX...
Updating plugin artifact...
Cloning git repository
Running pre_update.sh script
...
...
Installing new pkgs... 
Repo: plugin-default already exists, skipping!

Testing Host DNS response to pkg.FreeBSD.org
Testing ha--core's SRV response to pkg.FreeBSD.org
Testing ha--core's DNSSEC response to pkg.FreeBSD.org

Installing plugin packages:
- autoconf...
- bash...
- ca_root_nss...

Cloning git repository
Running post_update.sh script
Updated plugin successfully.
Updating jail...

 

fuji44

Cadet
Joined
Nov 12, 2019
Messages
3
but so far does not appear to caused any issues

I was relieved to hear that there have been no ill effects so far.

I happen to notice them while updating a plugin from the console. You may see the following lines in the example below

I see. Thanks for including the console example. It's easy to understand.

In my case, I was curious about the update process, and from the name post_install.sh I expected there to be a post_update.sh as well, so I searched GitHub and found your repository. I created a test plugin from there and saw the console output you mentioned.


Now, as for the main issue, I'm going to assume that it's not running in parallel for now.

It was a relief to hear your opinion, as you actually maintain the plugin. Thank you very much for taking your valuable time to answer my question.
 
Top