Installer Bug - no home directory check for 'fog' user
I noticed a bug/omission on the RC5 installer when upgrading this morning due to a mistake on my part from prior troubleshooting. If an admin has deleted the home directory for the ‘fog’ user but left the user account otherwise intact the installer doesn’t recreate the home directory when checking if the ‘fog’ user account is configured. This causes image captures to fail with an ftp error when the script tries to switch to /home/fog (which doesn’t exist). Recreating /home/fog and changing ownership/group to ‘fog’ fixes the issue. I can provide the exact error message from the httpd ‘error_log’ file if needed as well.
@Darrin-Enerson I’ve added the warning and an example method to correct the issue, I think, in a more proper method. This warning will be available for the RC6 (Hopefully it can just be 1.3.0 at that point, but meh.)
After reading Tom’s reasoning I tend to agree with the warning instead of recreation. I knew what I was doing when I deleted it and simply forgot to recreate it before continuing testing today. The warning would have given me a nice reminder to fix what I broke :).
I disagree with this being a bug.
While I understand the problem it causes, this is purely administrative at that point. While, sure it’s simple enough to add that kind of a thing, maybe you ACTUALLY did intend to delete the fog user folder? VSFTPD can be configured independently and you can direct it where to login first.
Mistakes happen, but that’s all the more reason for you to be mindful of what you’re doing.
If you accidentally make the mistake of running
rm -rf /there isn’t a utility to undo it. You still have to be aware of what you’re doing.
Mistakes happen. I will add check that warns people, essentially saying, hey I can’t find the home folder. But I’m not going to recreate. As I said, maybe the deletion was intentional.
@Tom-Elliott I am, after making the mistake and figuring it out.
@Wayne-Workman I realize I default to /home as the backup, because that’s most likely where the space is going to be. But you really should be aware of WHAT you’re deleting.
@Tom-Elliott With all the backups going into /home and being named with names like ‘fog’ it’s really easy for a new person to just delete everything in there unknowingly. I did it like twice so far, and I’m seasoned. Of course I figured it out and fixed it, but still.
The expectation that FOG create the fog user home directory is out of scope. If an administrator is deleting a folder (whether known or not, it’s outside the scope of the installer).
This, I think, should be made aware of, but not be handled directly by the installer. If you decide to delete the /home/fog folder, you should be aware of what issues it may cause.
Here’s the fix, that I suggest be included in the installer.
if [[ ! -d /home/fog ]]; then mkdir /home/fog chown -R fog:fog /home/fog fi