Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - How to obtain the working folder from with a script? #124932

Closed
DylanFromEdwards opened this issue Nov 25, 2024 · 2 comments
Closed

Question - How to obtain the working folder from with a script? #124932

DylanFromEdwards opened this issue Nov 25, 2024 · 2 comments

Comments

@DylanFromEdwards
Copy link

I have a .sh script executing, but I get an error:

"stepResults":{"step_0":{"resultCode":0,"extendedResultCodes":"30500205","resultDetails":"The install script doesn't create a result file '/var/lib/adu/downloads/7aebbd16-70df-4b74-8cce-39aceb13a66f/action_download_aduc_result.json'."

I've created a action_download_aduc_result.json file, but assume it needs to be stored in the correct folder. I assume it's the working folder or Sandbox folder?

Property '_workFolder' not NULL - returning cached workfolder '/var/lib/adu/downloads/7aebbd16-70df-4b74-8cce-39aceb13a66f'
Setting sandbox /var/lib/adu/downloads/7aebbd16-70df-4b74-8cce-39aceb13a66f [SandboxCreate:391]

The question is how do I reference this from within a script?

Copilot suggests using and environment folder, along the lines of...

sandbox_dir=$ADUC_SANDBOX_DIR

This gives an empty string within the script and the file gets written to /

The example https://github.com/Azure/iot-hub-device-update/blob/develop/src/extensions/step_handlers/script_handler/examples/example-installscript.sh expects an argument to be passed, but I can't find an example of the argument.

Could someone tell me how I get the working/sand folder in the script? Or where the result file should be written.

@PesalaPavan
Copy link
Contributor

@DylanFromEdwards
It would be great if you could add a link to the documentation you are following for these steps? This would help us redirect the issue to the appropriate team. Thanks!!

Thanks for your feedback and your contribution to Azure docs.
Feedback for this repository is moving away from GitHub to a system specific to the Microsoft Learn platform. Issues for this repository will soon be disabled, and additional comments from GitHub will no longer be possible. However, we are now tracking and triaging this issue in the new feedback system.
To learn more about our feedback systems, please see Provide feedback for Microsoft Learn content.

@DylanFromEdwards
Copy link
Author

The documentation I was following is here...

https://github.com/Azure/iot-hub-device-update/tree/develop/src/extensions/step_handlers/script_handler

I've also been trawling for examples from various places.

Is the Microsoft Learn platform for this project live? Could I have a link, if so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants