root@juju-04a5eb-5:# sudo -u nagios /snap/bin/nagios-substrate.blocksync -H ‘kilt-rpc.dwellir.com’ -c ‘1’ -w ‘2’
Sorry, home directories outside of /home are not currently supported.
See Support for non /home homedirs for details.
Nagios plugins runs as the user “nagios” which is in turn an account which should not have an account with home under /home. I hope there is a way to run plugins for nagios as a snap?
This is the account details for nagios on my system:
I would still like to get this fixed. Perhaps there is another directory I could use to make the snap work for nagios user. I’m looking through the documentation. https://snapcraft.io/docs/data-locations
It looks like I do need the /home directory even when using the snap data directories.
Snaps without the home interface declared and/or connected cannot access the disk. The $SNAP_USER_DATA directory will still be created and exist in the user’s home directory but it can contain no files
I was able to do the bind mount and got the nagios user working with check_cgminer snap. There was a little problem with the documentation for the bind mount however.
I think the bind mount is the way to go for nagios check snaps until snaps are allowed to have a home directory outside of /home.
I don’t think the bind mount will cause any issues with nagios or anything else on the system, so why not go that route?
To test I just did sudo -u nagios check_cgminer --help and I got the expected output. If there is another issue, please let me know.