[greengrass] how to add environment variable

0

I need to deploy the kvs program to the device. I don't know how to add environment variables when deploying with greengrass. Is there an example? like: “setEnv”: "export LD_LIBRARY_PATH={artifacts:path}/lib" // i use this way,but wrong

is there any type of use greengrass deploy kvs to device?

  • I don't want to compile on the device, so I'm going to put the executable directly in, and then add environment variables to make it run directly

gefragt vor 2 Jahren964 Aufrufe
2 Antworten
0

Hi. You can't do an export like that. Here is a JSON recipe example for Setenv: https://github.com/awslabs/aws-greengrass-labs-kvs-stream-uploader/blob/main/recipes/aws.greengrass.labs.kvs.stream.uploader-sample.json#L27

And a YAML example: https://github.com/awslabs/aws-greengrass-labs-jupyterlab/blob/main/recipes/aws.greengrass.labs.jupyterlab.yaml#L30

is there any type of use greengrass deploy kvs to device?

If I understand your question correctly, this component is likely of interest. It builds the KVS C SDK, links it into the component, and publishes the component for deployment: https://github.com/awslabs/aws-greengrass-labs-webrtc

profile pictureAWS
EXPERTE
Greg_B
beantwortet vor 2 Jahren
  • it still not work, when i use this: 14 "Lifecycle": { 15 "Run": "cd {artifacts:path} && {artifacts:path}/kvsWebrtcClientMasterGstSample ***" 16 "Setenv": { 17 "GST_PLUGIN_PATH": "{artifacts:path}/build", 18 "LD_LIBRARY_PATH": "{artifacts:path}/lib"
    19 } 20 }

0

I think you need to add RequiresPrivilege: true, and this works for me

  Run:
    RequiresPrivilege: true
    Script: "<command>"
    Setenv:
       LD_LIBRARY_PATH": "{artifacts:path}/lib
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen