Plugin to "Launch" linux applications and scripts
-
Build launcher plugin. It create /usr/lib/thunder/plugins/libThunderLauncher.so and /root/etc/Thunder/plugins/Launcher.json
Generated Launcher.json contains,
{ "locator":"libThunderLauncher.so", "classname":"Launcher", "precondition":[ "Platform" ], "startmode":"Activated" }
-
Update Launcher.json with the command to be run
E.g. to run command <
du -a /etc
>{ "locator":"libThunderLauncher.so", "classname":"Launcher", "precondition":[ "Platform" ], "startmode":"Activated", "configuration": { "command":"du" } }
-
Update json field:"paramters" with options/values if required
E.g. to run <
du -a /etc -h
>{ "locator":"libThunderLauncher.so", "classname":"Launcher", "precondition":[ "Platform" ], "startmode":"Activated", "configuration": { "command":"du", "parameters": [ { "option": "-a", "value": "/etc" }, { "option": "-h"} ] } }
- Add 'relative' time information to the Launcher.json in the HH:MM.SS format (Hour:Minute.Second)
"configuration": { "command":"du", "parameters": [ { "option": "-a", "value": "/etc" }, { "option": "-h"} ], "schedule": { "mode": "relative", "time": "06:04.10" } }
Note:
- If field "mode" is empty or not set, it will treat the time as relative
- If relative time value is "00:00.00"/not set, the launcher will ignore the given time and launch the application at the launcher activation time itself.
- If time format given is a. "XX", treat it as SS b. "XX.XX" treat it as MM.SS
- Add 'absolute' time information to the Launcher.json in the HH:MM.SS format (Hour:Minute.Second)
"configuration": { "command":"du", "parameters": [ { "option": "-a", "value": "/etc" }, { "option": "-h"} ], "schedule": { "mode": "absolute", "time": "06:04.10" } }
Note:
- If absolute time value is not set, the launcher will ignore the given time and launch the application at the launcher activation time itself.
- If time format given is a. "XX", treat it as SS, and schedule the application launch at next SSth time. i.e. if absolute time given is 25 and current time is 08:10:45, then the application will be launched at 08:11:25 b. "XX.XX" treat it as MM.SS, and scedule the application launch at next MM:SSth time. i.e. if absolute time given is 30.20 and current time is 08:10:45, then the application will be launched at 09:30:20 c. "00:00.00" treat it as midnight.
- If absolute time given is less than the current time, it will launch the application the same time at the subsequent day. i.e, if absolute time given is 13:00:00, it will launch the application at same time at the next day.
- Add interval time information to the Launcher.json in the HH:MM.SS format (Hour:Minute.Second)
"configuration": { "command":"du", "parameters": [ { "option": "-a", "value": "/etc" }, { "option": "-h"} ], "schedule": { "mode": "interval", "time": "06:04.10", "interval": "00:40.10" } }
Note:
- If interval value is "00:00.00"/invalid format/not set, the launcher will treat it as invalid value and ignore the interval time settings.
- If mode is interval (absolute with interval) and interval is set, it will identify next matching time and schedule application launch to that time. i.e, if the absolute time given is 04:00:00, current time is 05:10:00 and interval is 00:30:00, then next scheduling time will be 05:30:00 (will be identified from the next intervals - 04:30:00, 05:00:00, 05:30:00)
- If mode is relative or absolute, the interval time will be taken only for the subsequent scheduling
add closetime parameter into the json with the average closing time for the script or application. This will wait till that configured time for a clean exit of process/script.
{
"locator":"libThunderLauncher.so",
"classname":"Launcher",
"precondition":[
"Platform"
],
"startmode":"Activated",
"configuration": {
"command":"du",
"closetime":5
}
}
E.g.
testapp1, testapp2 and testapp3 are the three applications to be run
-
Create testapp1.json by copying Launcher.json (cp Launcher.json testapp1.json) and update with proper commands and option/values
-
Create testapp2.json by copying Launcher.json (cp Launcher.json testapp2.json) and update with proper commands and option/values
-
Create testapp3.json by copying Launcher.json (cp Launcher.json testapp3.json) and update with proper commands and options/values
-
Run Thunder