mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Remove expected_services_num from service list
This commit is contained in:
parent
a720c8a990
commit
0f8a98b500
2 changed files with 19 additions and 7 deletions
|
|
@ -975,16 +975,12 @@ static const struct blobmsg_policy service_policy[] = {
|
|||
static void service_list(struct blob_buf *bb)
|
||||
{
|
||||
void *array;
|
||||
char val[32] = {0};
|
||||
char cmd[] = "grep -hsw bbfdm_add_service /etc/init.d/*|wc -l";
|
||||
|
||||
array = blobmsg_open_array(bb, "supported_cmd");
|
||||
blobmsg_add_string(bb, NULL, "register");
|
||||
blobmsg_add_string(bb, NULL, "list");
|
||||
blobmsg_close_array(bb, array);
|
||||
|
||||
run_cmd(cmd, val, sizeof(val));
|
||||
blobmsg_add_u32(bb, "expected_services_num", atoi(val));
|
||||
array = blobmsg_open_array(bb, "registered_service");
|
||||
get_list_of_registered_service(&head_registered_service, bb);
|
||||
blobmsg_close_array(bb, array);
|
||||
|
|
|
|||
|
|
@ -79,11 +79,27 @@ It's a three step process, if DotSO or JSON plugin already present, if not refer
|
|||
}
|
||||
```
|
||||
|
||||
3. Update init script to start the datamodel micro-service, which made simpler with `bbfdm` [init hooks](https://dev.iopsys.eu/feed/iopsys/-/commit/8bdfd3ea51a81941ee9c53a46a66cf6c0f6eb88f)
|
||||
3. Add an uci-default script to add the micro-service in bbfdm
|
||||
|
||||
```bash
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
bbfdm_add_service "bbfdm.bulkdata" "/etc/bulkdata/input.json"
|
||||
$ cat bulkdata/files/etc/uci-defaults/50_add_bulkdata_dm_microservice
|
||||
#!/bin/sh
|
||||
|
||||
if ! uci -q get bbfdm.bulkdata >/dev/null; then
|
||||
uci set bbfdm.bulkdata=micro_service
|
||||
uci set bbfdm.bulkdata.enable=1
|
||||
uci set bbfdm.bulkdata.input_json="/etc/bulkdata/input.json"
|
||||
uci set bbfdm.bulkdata.loglevel=1
|
||||
fi
|
||||
```
|
||||
|
||||
Which adds a micro-service handler into bbfdm uci
|
||||
|
||||
```bash
|
||||
config micro_service 'bulkdata'
|
||||
option enable '1'
|
||||
option input_json '/etc/bulkdata/input.json'
|
||||
option loglevel '1'
|
||||
```
|
||||
|
||||
## When to switch to micro-service model
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue