This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Startup (Init) Script
#1
Hi

What's the best way to make changes to the Start-up (Init) script?   I can see that rebooting the device will force my updates into the runnings script, however is there another way to kill the running script and restart it?  I'm on the Schneider SHAC version of LogicMachine.

Kind Regards
James
Reply
#2
Init script modification: https://forum.logicmachine.net/showthrea...9#pid27089
Use script.reload() to reload event scripts, restart resident scripts and update scheduled scripts.
Reply
#3
Is it as simple as creating another script which refers to the init script by it's id - or is there a different way to refer to it?

Kind Regards
James

Code:
script.reload('initscript')
Reply
#4
You don't need to "reload" the init script. Just update the source file and it will be used during next boot. If you want to call init script again you should put code into a common function that can be called from multiple scripts.
Reply
#5
I was trying to avoid rebooting the device as we're developing / making changes to the init script.

Will the script.reload('initscript') call do this or do we have to reboot the Schneider SHAC version of LogicMachine to see changes made to the init script we're developing?

Many thanks
Reply
#6
script.reload('initscript') is not a valid call. The only thing you need to do is write code directly to the init file, no other actions are needed.
Code:
-- overwrite init script
io.writefile('/usr/share/lua/genohm-scada/initscript.lua', scripttext)
Reply


Forum Jump: