appdaemon icon indicating copy to clipboard operation
appdaemon copied to clipboard

Permission denied with mount command

Open maxalbani opened this issue 3 years ago • 8 comments

What happened?

I need to run a subprocess mount command from an appdaemon script, but I get error code 255 (Permission Denied). The same command if executed from the shell works correctly. How can I do? Thank you!

Version

Add-on version: 0.11.0

Installation type

Home Assistant add-on

Relevant log output

output from subprocess run:
CompletedProcess(args=['mount -t nfs4 192.168.68.6:/volume1/NetBackup /mnt'], returncode=255, stdout='', stderr='mount: mounting 192.168.68.6:/volume1/NetBackup on /mnt failed: Permission denied\n')

Relevant code in the app or config file that caused the issue

No response

Anything else?

No response

maxalbani avatar Apr 10 '23 08:04 maxalbani

This depends on which user is running the AppDaemon code - I don't know how this works in supervised HASS, you might try asking the question over there.

acockburn avatar Apr 18 '23 11:04 acockburn

This is not an AppDaemon issue.

Additionally, from the add-on you won't be able to do that, as the needed permissions are not available.

frenck avatar Apr 18 '23 12:04 frenck

Closing per @frenck 's comment.

acockburn avatar Apr 18 '23 12:04 acockburn

May be possible if you add the mount point to configuration.yaml under external dirs:

allowlist_external_dirs: - "/config/www/path/to/mount/point"

boriken72 avatar Apr 18 '23 12:04 boriken72

@boriken72 No, that is not possible. See my comment above.

frenck avatar Apr 18 '23 12:04 frenck

thanks all, i fixed it with a shell_command from HA

maxalbani avatar Apr 18 '23 13:04 maxalbani

My response was based on me running appdaemon in HASS and knowing that unless you add it to the allowlist_external_dirs the directories are protected. I've had to use that list to allow process to write/use the disk. To your point though this is not an appdameon limitation - this is a HASS limitation.

boriken72 avatar Apr 18 '23 13:04 boriken72

and knowing that unless you add it to the allowlist_external_dirs the directories are protected.

That option isn't related. It is a permission issue, as per above.

frenck avatar Apr 18 '23 14:04 frenck