Comment 2 for bug 2004543

Revision history for this message
Rod Smith (rodsmith) wrote :

The maniacs_setup code currently uses the following line to determine the "default" user:

DEFAULT_USER=$(getent passwd | awk -v val=1000 -F ":" '$3==val{print $1}')

I don't know why it uses this method, offhand; the more obvious, and simpler, method would be:

DEFAULT_USER=$(whoami)

This alternative method would set up MAAS using the currently-logged-in user account rather than the account with UID 1000. Offhand, that seems like a better approach. When following MANIACS to the letter, the two should produce identical results, but if one were to deviate (say, by creating two accounts and using the second one, with UID 1001, to run maniacs-setup), setting DEFAULT_USER to the value of $(whoami) should work better. Obviously, this should be tested before committing a change.