Newgrp has a side effect of not only dynamically adding the group to the user but also making it the primary group, which seems wrong to me. All files created during the node-prepare script will be owned by <user>:snap_daemon instead of <user>:<user-group>.
In my installations, I always remove the newgrp command and then at the end of the script I logout and login again. It is an extra step but it seems unavoidable.
Newgrp has a side effect of not only dynamically adding the group to the user but also making it the primary group, which seems wrong to me. All files created during the node-prepare script will be owned by <user>:snap_daemon instead of <user>: <user-group> .
In my installations, I always remove the newgrp command and then at the end of the script I logout and login again. It is an extra step but it seems unavoidable.