OH starting vs. loading model

Windows 11, OH 4.2.2 (the same problem in version 4.2.1).

I have 2 external scripts in the catalog /conf/scripts/ when the OH is starting I see in the logs that there scripts are loading into the model like in the logs:

05.11.2024 08:49	 [INFO ]	 [el.core.internal.ModelRepositoryImpl] - 	Loading model 'ex_PhotoOfDay.script'
05.11.2024 08:49	 [INFO ]	 [el.core.internal.ModelRepositoryImpl] - 	Loading model 'Switches-All-OFF.script'

But the main question is - why the scripts are running when the server is starting?!?!

I understand that the scripts are loading into the OH model, but why need to be started? How to skip running these scripts?

Scripts are not automatically triggered as far as i know, so do you have a rule which triggers those scripts?
If yes you could check the start level in that rule to ensure that it only gets executed when a certain level is reached (see also Rules | openHAB)

00 - OSGi framework has been started.
10 - OSGi application start level has been reached, i.e. bundles are activated.
20 - Model entities (items, things, links, persist config) have been loaded, both from db as well as files.
30 - Item states have been restored from persistence service, where applicable.
40 - Rules are loaded and parsed, both from db as well as dsl and script files.
50 - Rule engine has executed all "system started" rules and is active.
70 - User interface is up and running. (planned, not included yet)
80 - All things have been initialized. (planned, not included yet)
100 - Startup is fully complete.

Just to add a few more details, the script is loaded at that point, not running. It’s been loaded into memory and parsed and made ready to be run but, as @Sascha_Billian notes, it is not running unless you have a rule which calls those scripts using the callScript Action from a Rules DSL rule. (See Actions | openHAB). I think these can also be called using runRule in other languages and of course callScript is also available there as well.

Note that this also applies to rules. Rules will be loaded at OH startup time but won’t run until triggered.

Therefore, if those scripts are indeed running, that means you have a rule that calls them. Likely a rule triggered by a system started or runlevel trigger.

You have right! Thank you. Mea culpa. There was a scrippt called these external. Corrected. Thank you @Sascha_Billian !

My mistake. Right. Sctips all not called normally during started OH.

Thank you @rlkoshak !