TRITON-2159: Port `/lib/sdc/config.sh` to linux

Details

Issue Type:New Feature
Priority:4 - Normal
Status:Resolved
Created at:2020-08-25T14:48:31.196Z
Updated at:2022-08-10T00:18:37.503Z

People

Created by:Pedro P. Candel
Reported by:Pedro P. Candel
Assigned to:Pedro P. Candel

Resolution

Fixed: A fix for this issue is checked into the tree and tested.
(Resolution Date: 2020-09-02T18:21:17.553Z)

Fix Versions

2020-10-08 calmer than you are (Release Date: 2020-10-08)

Related Issues

Labels

linuxcn

Description

/lib/sdc/config.sh and the function called load_sdc_config are used extensively across the different triton components, specially from sdc-config-agent.

This library should be ported to linux, probably doing something similar to what we do for sys info and add it as part of the sdc-cn-agent here:

https://github.com/joyent/sdc-cn-agent/blob/linuxcn/lib/backends/linux/smartdc-config.js

That could be used like sysinfo from /usr/bin/triton:

cat /usr/triton/bin/sysinfo
#!/usr/node/bin/node

var sysinfo = require('/usr/triton/sdc-cn-agent/lib/backends/linux/sysinfo');
sysinfo.sysInfo(null, function (err, info) {
    console.log(JSON.stringify(info, null, 2))
});

The original, smartos code for this library is here:

https://github.com/joyent/smartos-live/blob/master/src/lib/sdc/config.sh

Comments

Comment by Pedro P. Candel
Created at 2020-09-02T18:21:17.568Z

Ok, for now the file is added to /usr/triton/config/config.sh and all it does is being sourced by other scripts which will then call load_sdc_config, which is exactly what the agents being ported to linux need for configuration and setup.

There are other features that can be added, like outputting JSON or providing other Configuration information for linuxcns, but that will not happen if we have no need for it.


Comment by Jira Bot
Created at 2022-08-10T00:18:37.503Z

linux-live commit f4b6b845c5b978465aac166efaff23abb5b96cdc (branch master, by Pedro Palazón Candel)

TRITON-2159 Port `/lib/sdc/config.sh` to linux