Automatic login

This forum is to find answers to problems you may be having with ZEVO Community Edition.

Moderators: jhartley, MSR734, nola

Re: Automatic login

Post by mk01 » Mon Mar 04, 2013 7:42 am

raattgift wrote:"There is nowhere written in the docs"

Please see both paragraphs in the "User Home Directories" section in http://images.apple.com/business/docs/Autofs.pdf
and the mnthome(1) man page.


Man, I really don't know, why you are doing this to yourself. The docs from 2009 are generation obsolete. The paragraph literally means the consequence that you can't log another user to a machine while network account is logged on (even with fast user switching) - as I said before (ok, this can be easily solved by auto home mounting of NFS, but Apple pretend, there is no NFS).

You already forgot that: we are on open directory, where you have path to user dir (used for local logins) and user dir url (for remote logins). During local login the path is used (and specially with autofs and autohome mounts local to the machine are converted to links + mac doesn't allow local mounts, right?). So we have just local filesystem with user dirs - like standalone mac without directory bond. So specially for you this time, macos is trying to unmount this filesystem upon logout - I don't care, I can watch for folder change via launchd and remount. And now surprise surprise - if this fs is a let's say zfs root fs on a zfs pool, this umount is successful even if there are other mounted filesystems on it with open files - those stay mounted in the air and any try to remount the root fails. And let me again tell you, that I'm not talking about user home dirs as a mounts. One partition, one filesystem holding user dirs + public shares (default mac factory setup).

I'm talking about ZEVO allowing to umount zfs filesystem with open references on it / active mounts within a hierarchy. and that is a fail.
And the Apple's concept of "Full path" as path to directory under which user home is, than "Path to Home Folder" which is one level under pointing to actual user dir + Share point URL splitted into mount URL and path is again fail and shooting into own positions, because what happens if the mount is local to the machine? Remember, auto mount takes the "Path to Home Folder", creates a symlink to actual directory, ... which is by mistake/bug during logout resolved into filesystem mount - if and only if this is another filesystem suposed holding the user dirs directly under it's root dir.
mk01 Offline


 
Posts: 65
Joined: Mon Sep 17, 2012 1:16 am

Orientation

Post by grahamperrin » Mon Mar 04, 2013 2:39 pm

mk01 wrote:… a different topic, I have more problems with Macosx unmounting the user home dir during logout …


I'm interested, but the logout discussion doesn't fit under automatic login. Would you like to make a separate topic? Thanks.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Automatic login

Post by jollyjinx » Mon Mar 04, 2013 4:12 pm

grahamperrin wrote:No problem here.

shuman wrote:… warn the user that the filesystem is not mounted …


For me, the operating system (Mountain Lion) never allows log in before the file system for my home directory is mounted. There's no explicit warning, simply an error –

> You are unable to log in to the user account "gjp22" at this time.
> Logging in to the account failed because an error occurred.

2013-03-02 08-49-57 IMG_0433.JPG


My NFSHomeDirectory is
/Volumes/gjp22

and:

Code: Select all
sh-3.2$ zfs get mountpoint gjp22
NAME   PROPERTY    VALUE           SOURCE
gjp22  mountpoint  /Volumes/gjp22  default



What do you mean with NFSHomeDirectory ? Is there a setting to tell MacOSX that my Homedirectory is a NFS mounted one and it waits then till it's mounted ( even though it's mounted by zfs actually ) ?

Patrick
jollyjinx Offline


 
Posts: 60
Joined: Sun Sep 16, 2012 12:40 pm
Location: Munich - Germany

NFSHomeDirectory

Post by grahamperrin » Mon Mar 04, 2013 10:08 pm

NFSHomeDirectory is Open Directory terminology, and may be used without NFS.

You'll see this attribute when Directory Utility is used,
/System/Library/CoreServices/Directory Utility.app

Or with dscl(1) for example:

Code: Select all
macbookpro08-centrim:~ gjp22$ dscl  . -read /Users/gjp22 NFSHomeDirectory
NFSHomeDirectory: /Volumes/gjp22


Maybe a little outdated, but for context: Understanding Similar LDAP Attributes | Accessing Mac OS X Server Directory Services | Peachpit (page 3).
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Automatic login

Post by jollyjinx » Tue Mar 05, 2013 2:59 am

Well, maybe it's cause my Home directory is /Local/Users/jolly and your /Volumes is a special case for loginwindow. But I have not found evidence for that assumption (strings on loginwindow).
I've created a new account tester with it's home in /Volumes/tester and loginwindow just creates the homedirectory when it does not find the directory.

Is there a setting to disable loginwindow to create the home directory when it does not exist ? What else might be different in your setup that it's telling you to wait ?

puzzled - Patrick
jollyjinx Offline


 
Posts: 60
Joined: Sun Sep 16, 2012 12:40 pm
Location: Munich - Germany

Re: Automatic login

Post by jollyjinx » Tue Mar 05, 2013 4:30 am

Well, as I do know how to get in to rescue mode, I'm now using a differrent approach:

sudo defaults write /System/Library/LaunchDaemons/com.apple.loginwindow.plist KeepAlive -dict PathState ' { "/Local/Users" = "true";}'

So loginwindow will only be launched when my ZFS mount ( /Local ) is actually mounted.
If there is a problem with zfs mounting the pool there is no loginwindow, but I do have other problems then as well , so a rescue reboot will be neccessary anyways.

Patrick
jollyjinx Offline


 
Posts: 60
Joined: Sun Sep 16, 2012 12:40 pm
Location: Munich - Germany

Re: Automatic login

Post by grahamperrin » Tue Mar 05, 2013 1:27 pm

jollyjinx wrote:… What else might be different in your setup that it's telling you to wait ? …


Whilst the dialogue uses the words "at this time" it's not enough to simply wait.

The probable difference in my case:

  • Core Storage for encryption of a LV; with that LV given to ZEVO, and that pool|dataset (gjp22|gjp22) is my home directory.

There's also Core Storage for encryption of the LV that's the startup volume. Critically: if authentication at efiLoginUI is as gjp22, then:

  • the LV for startup is unlocked
  • the LV for pool gjp22 is not unlocked; that's how I can easily produce the dialogue in the screenshot at viewtopic.php?p=4124#p4124

… 
sudo defaults write /System/Library/LaunchDaemons/com.apple.loginwindow.plist KeepAlive -dict PathState ' { "/Local/Users" = "true";}'
… 


Earlier I wondered whether you might do something with wait4path(1) but if the approach above does what's required with the daemon, then great :)

Incidentally, for an average user my advice might have been simply, to not attempt automatic login. But that's a lazy workaround and you're not the average user ;) so it'll be good to get something better than my laziness.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Re: Automatic login

Post by raattgift » Tue Mar 05, 2013 9:23 pm

It might also be useful to chflags schg on the mountpoint directory (when nothing is mounted, of course, and when it's empty) to prevent things like .bash_history or Movies/ or the like from being created in at login when the zfs-based filesystem has not mounted for some reason.

This avoids a refusal to mount a zfs dataset at a mountpoint that is a non-empty directory.
raattgift Offline


 
Posts: 98
Joined: Mon Sep 24, 2012 11:18 pm

Re: Automatic login

Post by jollyjinx » Wed Mar 06, 2013 1:06 am

Ah, so the two LV's with passwords is the difference then.

I actually have not enabled automatic login, but when you enable encryption on the boot volume you are automatically logged in. I had to create a user that was added to the FV volume to later remove that user to be able to unlock the drive at EFI boot and NOT get automatic login to my user. Loginwindow was trying to login user and then found out that that user no longer existed and just displayed a normal login window ( after about 20 seconds or so ).

Do you have the two LV on one disk or on the same ?

Patrick
jollyjinx Offline


 
Posts: 60
Joined: Sun Sep 16, 2012 12:40 pm
Location: Munich - Germany

Re: Automatic login

Post by grahamperrin » Thu Mar 07, 2013 2:19 pm

jollyjinx wrote:… when you enable encryption on the boot volume you are automatically logged in … 


A Disk Password approach to the startup volume (entering a password for the disk, not for a user) can take you to the loginwindow array of users (plus Guest), but no further; no automated login. Essentially:

  • before installing the OS, erase and encrypt the volume.

Answered in Ask Different: For a FileVault user of Mountain Lion: can I avoid the automated login, which normally follows unlock of the encrypted startup volume?

Do you have the two LV on one disk or on the same ?


One.
grahamperrin Offline

User avatar
 
Posts: 1596
Joined: Fri Sep 14, 2012 10:21 pm
Location: Brighton and Hove, United Kingdom

Previous

Return to Troubleshooting

Who is online

Users browsing this forum: bileyqrkq, ilovezfs and 0 guests

cron