No description
- C++ 98.7%
- CMake 1.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| appinfo.cpp | ||
| appinfo.h | ||
| CMakeLists.txt | ||
| executionmanager.cpp | ||
| executionmanager.h | ||
| log.cpp | ||
| log.h | ||
| main.cpp | ||
| README.md | ||
| startup_service.dinit | ||
| startup_service.systemd | ||
Custom Startup Scheduler
App reads from a json file containing a list of apps. It then schedules the apps for execution.
Example:
A sample startup json may be:
[
{
"name": "LS 0",
"app_name": "/bin/ls",
"app_args": ["-l"],
"run_mode": "script",
"create_log": true,
"working_dir": "/home/"
},
{
"name": "LS 1",
"app_name": "/bin/ls",
"app_args": ["-l"],
"run_mode": "script",
"create_log": true,
"after": [{"module": "LS 0", "state": "exited"}],
"env": {"PATH": "/home/:/usr/bin/", "NAME": "ONE"},
"working_dir": "/home/etc",
"run_as": "username",
"run_every": "10s",
"run_on_start": true
},
{
"name": "LS 2",
"app_name": "/bin/ls",
"app_args": ["-lh"],
"run_mode": "script",
"create_log": true,
"after": [{"module": "LS 0", "state": "exited"}],
"working_dir": "/home/etc/Documents",
"run_on_start": false,
"run_at": "1,15,30 01:30:00 Monthly"
}
]
App Arguments:
- --threads | -t : Specify the number of worker threads [Default is 16].
- --log_dir | -ld: The directory to dump log files into. Stdout and Stderr are redirected to a file in this folder with naming convention of MODULE_NAME.log
- --json | -j: Specify the location of the json file containing the list of modules to run.
- --test | -T: Test the json file for errors.
Json Parameters:
| Key | Type | Description |
|---|---|---|
| name | String | Identification name of the module. Log files will be saved with this name. |
| app_name | String | Path to executable of the module. |
| app_args | List[String] | List of arguments to the executable. |
| run_mode | String | Value should be "script" or "daemon". "script" modules are waited on to finish. "daemon" modules are forked and forgotten. |
| create_log | Boolean | Boolean to indicate whether to direct output to file specified by log_dir argument. |
| after | List[DICT{"module": name, "state": STATE}] |
List of modules and their states provided for dependancy management. |
| working_dir | String | Executable working directory. |
| run_on_start | Boolean | Used with run_at or run_every to toggle starting the executable when the startup App is first launched. |
| run_at | String | Used to specify time points at which to run the executable. |
| run_every | String | Used to specify intervals at which to run the executable. |
| env | DICT{key: value} | Used to specify additional environmental variables to the executable. |