Permission denied with mount command
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
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.
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.
Closing per @frenck 's comment.
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 No, that is not possible. See my comment above.
thanks all, i fixed it with a shell_command from HA
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.
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.