Best way to restart a Greengrass component, from another component

0

My requirement is to have one greengrass component, upon receipt of an MQTT message, update the local config file for another component, and then restart the other component.

Upon restarting, this config file is read by another gg component.

My issue is running the 'greengrass-cli component restart' command from another component, as it does not have sufficient priveleges to run that command.

I know another approach would be to send an IPC message from one component to another, and upon receipt of that message, the receiving component could do some restart/re-init task. However in our use case, it would be far easier to simply restart the other component altogether.

Are there any suggested ways to achieve this? Is it possible to restart a component in any way other than the 'greengrass-cli component restart' command?

3개 답변
0

Another way to fulfill your use case is to have the "other" component to watch the config file. This is similar to the IPC solution but with this approach you are not limited to the programming languages supported by the Greengrass SDK.

AWS
전문가
답변함 2년 전
0

Using the CLI is the only way to restart a component at this time. Assuming that you control the code in the component which is reading the configuration file, you could update it such that it calls exec to create a new instance of itself with the updated configuration. Even more ideally, it could be written to dynamically update based on configuration changes, for example by using our configuration subscription IPC https://docs.aws.amazon.com/greengrass/v2/developerguide/ipc-component-configuration.html#ipc-operation-subscribetoconfigurationupdate.

AWS
전문가
답변함 2년 전
0

Hi , apologies for the delay on this follow up -

The documentation for the greengrass-cli component has a configuration for "AuthorizedPosixGroups". If I explicitly add the user (ggc_user) to this group, will I be able to invoke the restart command from another component without using any of the workarounds suggested?

LInk to docs: https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-cli-component.html

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠