You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mavericks Server Keychain not properly storing information network users.

OS 10.9.1, Server 3.0.2. Clients OS 10.9.1 bound to server Open Directory and managed with Profile Manager. 10.6.8 Mail server bound to 10.9.1 server Open Directory. Messages is running on the 10.9.1 server which hosts the users.


Changeip -checkhostname indicates DNS is correct for the server. Server is running on a FQDN, no .local or other DNS issues.


For everything below: the Keychain for any of the users does not need to be repaired.


Generally things are going well with one exception which is a big problem.


Each time a network user logs and tries to use either Mail to connect to our mail server via IMAP or Messages in they are prompted for passwords. Messages takes the password and logs in. Mail acts as though the password was incorrect and asks for it again, it does not pass the connection to the mail server. There is no trace of the attempted login on the mail server logs.


Functional workarounds:


1 - OS reinstall allows immediate login on the mail server and connections as expected. This is a little too much for day to day use.


2 - (From somewhere in the forums forgot who, sorry), User login, go to User's network home/Library/Keychains and move any keychains with long strings of letters and numbers as name to another folder or put in trash, immediately reboot, User login again, enter passwords in Mail, immediate connection to mail server and expected behavior from Mail.app.


As a network user machine in a multi user environment, the next user will have to repeat the entire procedure above, including the reboot, to get access to the contents of the mail server. The first user in the example above will have to repeat it, if they come back to the same machine and log in again.


This is what we are doing now. It appears that it would work on a personal machine with local users and has solved a lot of issues in the forum. It is helping but does not solve the keychain problem for network users.


Does anyone have any advice.


Thanks.


-Erich

OS X Server

Posted on Jan 10, 2014 6:34 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 28, 2017 12:32 PM

It is our experience that it is still problem, in fact several different problems. 😟


Whilst there are many issues two of the major ones are -


  1. The 'new' local items keychain used for Apple programs passwords e.g. Mail, Contacts, etc. is stored in a per machine specific folder rendering it unusable for hot-desking
  2. Each new version of OS X has increased the use of SQLite databases to store settings and data and when used over a network as with network home directories these either get corrupted or locked so they cannot be used making programs like Mail, Contacts, and even Safari unusable, recent new uses include local items keychain itself and the new suggestions database for spotlight and looking up contacts and calendar entries in emails etc.


While I am still in the processing of reporting these issues to Apple especially the new SQLite problems I am in the process of changing all our users and giving up on network home directories. 😟

278 replies

Oct 21, 2015 2:47 AM in response to Erich Wetzel

Hi Erich,


I've been watching this thread since the beginning of last year when i first came across this frustrating issue. I even contacted Apple Support and shared with them my experiences. They assured me this issue was on the top of their list to fix. I eventually gave up and decided to stay with Mountain Lion for all our clients. But, a few days ago i decided i'd test El Capitan clients with my current server setup (Server 5.0.4 running on Yosemite). I performed two clean installs (not upgrades) of El Capitan. So far, i have not experienced the issue i had with the local items keychain that i did with Mavericks and Yosemite clients. When a user password is changed, i now get the "The system was unable to unlock your login keychain" upon the next login attempt, i'm able to enter my old login password and everything seems to be fine. This popup dialogue seemed to be missing in the past when i experienced the issues with the local items keychain. I may be jumping the gun here and this issue may raise it's ugly head again sometime soon, but have you tried testing with clean installed 10.11 clients?


User uploaded file

Nov 9, 2015 8:40 AM in response to gohara709

Hello


Apple has no intension to fix this problem. It first occurred with 10.9.2. Now with 10.11.1 the problem is still their? So in 1 1/2 year they haven't used their resources to fix this bug! The only thing they do is deleting comments about this issue in this forum?


I have lost the hope that apple will fix it they have probably other priorities!!! Maybe Schools are not interessing enough anymore, or they will push the schools to use iPads?


The best is that everyone complain in the feedback link at the Apple Site. As more complain the better URL: www.apple.com/feedback/


Regards

Gérard


p.s. What is your location? US or Europe (German speaking Areas)?

Nov 9, 2015 10:21 AM in response to Gerard Dirks

Gerard,


I sympathize with your frustration and am probably at a similar level since I started this thread at the beginning of 2015. However, the use use agreement for this site Apple Support Communities Use Agreement do give Apple the right to do what they wish as it is their property. The messages they have removed were ones that complained about their policies or suggested what they would or would not do, which goes against the policy of the site listed, specifically:


Submissions

Stay on topic. Apple Support Communities is here to help people use Apple products and technologies more effectively. Unless otherwise noted, do not add Submissions about nontechnical topics, including:

  1. Speculations or rumors about unannounced products.
  2. Discussions of Apple policies or procedures or speculation on Apple decisions.



We, as outsiders, can't possibly know their internal policies or what they plan to do or what they may be doing. We need your voice too. Please try to keep the comments tempered so that they stay in the discussion.


That said, I have reached out to someone at Apple outside of the usual call center who indicated that they have been able to take this issue to the software development team which would be responsible for this issue. I do not know what will happen next but it is another way of attempting to address the problem.


-Erich

Nov 17, 2015 11:59 PM in response to Erich Wetzel

Hello Guys!


So - because Apple ignores this bug we have to think how to come over it.


I played around with LoginHook and I think I ´ve found a solution. The problem is to find out which user is logged in and which user just logged out.


So here is my idea:

A LogoutHook starts a script that collects every user that has processes running and compares it to a list with user that have a process named "Finder.app" running. Every process of a user (some exceptions, like system users, etc.) that has no "Finder.app" running gets killed.

There are some problems, for example if you are logged in via ssh you will get kicked out as soon as the current console user logs out.


And here is what I have done:

sudo defaults write com.apple.loginwindow LogoutHook /usr/local/bin/scripts/logout_helper.sh


This is "logout_helper.sh":

#!/bin/bash


LOG=/Users/Shared/logout_helper.log

DATE=`date`


echo LOGOUTEVENT - $DATE >> $LOG

/usr/local/bin/scripts/kill_left_running.sh &


And this is "kill_left_running.sh"

#!/bin/bash

# C & E Mediensysteme GmbH, Christoph Ewering 20151117

# Dinge die Apple reparieren sollte aber nicht tut :-(


# Findout who has logged out

# We are looking for processes that run as USER but this USER has no Finder running


# Find every user but ignore system users and special users

# 1. Get every process and extract the user

# 2. remove row titel "USER"

# 3. remove every system user (Usernames that start with "_")

# 4. remove users that are listed in /var/root/users_to_ignore.txt for example "root" or "postgres"

# 5. sort the users and make every item in the list unique


USERLIST=`ps aux |awk '{print $1}' |grep -v USER |grep -v '^_' |grep -v -f /var/root/users_to_ignore.txt |sort |uniq`


# Now we look for users that are running a process called "Finder"


USERLOGGEDIN=`ps aux |grep Finder.app |grep CoreServices |awk '{print $1}' |sort |uniq`


# a user that is at list USERLIST but not at USERLOGGEDIN still has processes running but is no longer logged in

for USER in $USERLIST; do

if [[ $USER != $USERLOGGEDIN ]]; then

# User has no Finder running every other process of this user should be stopped

# Get all still running processes of the user that is logged out

PROCLIST=`/bin/ps -o pid -u $USER |grep -v PID`

logger "User $USER has still `/bin/ps -o pid -u $USER |wc -l` processes running, trying to stop them NOW."


# Dear processes would you be so kind to stop your work, please?

for PROC in ${PROCLIST}; do

#echo kill -15 $PROC

/bin/kill -15 $PROC

done


/bin/sleep 3


# PROCESSES - SHUT UP!

PROCLIST=`/bin/ps -o pid -u $USER |grep -v PID`

logger "User $USER has still `/bin/ps -o pid -u $USER |wc -l` processes running, kill them NOW."

for PROC in ${PROCLIST}; do

#echo kill -9 $PROC

/bin/kill -9 $PROC

done

fi

done


And the exception file "/var/root/users_to_ignore.txt" contains this:

postgres

root

nobody


I did no intensive testing, I am not an experienced bash script writer and there are some other problems from Apples side.

For example it is unknown how long the system will support the LogoutHook mechanism and I´ve read that a LogoutHook has to be fast or it get kill by the system. But AFAIK my testing shows that the above works.


Improvements are highly appreciated


Thanks, bye,

Christoph

Nov 20, 2015 9:44 AM in response to Christoph Ewering1

So here is my first experience with this script - installed at customers site


I found a computer where only one user was logged in but four users had still processes running - installed my script - logged out the user and voila my ssh session died 😊 -but that was expected.


Here is what is logged into system.log:

grep processes /var/log/system.log

Nov 20 18:23:03 mymac.atmysite.de mymac[29560]: User user1 has still 16 processes running, trying to stop them NOW.

Nov 20 18:23:06 mymac.atmysite.de mymac[29598]: User user1 has still 10 processes running, kill them NOW.

Nov 20 18:23:06 mymac.atmysite.de mymac[29615]: User user2 has still 18 processes running, trying to stop them NOW.

Nov 20 18:23:09 mymac.atmysite.de mymac[29647]: User user2 has still 16 processes running, kill them NOW.

Nov 20 18:23:10 mymac.atmysite.de mymac[29669]: User user3 has still 15 processes running, trying to stop them NOW.

Nov 20 18:23:13 mymac.atmysite.de mymac[29697]: User user3 has still 13 processes running, kill them NOW.

Nov 20 18:23:13 mymac.atmysite.de mymac[29716]: User user4 has still 14 processes running, trying to stop them NOW.

Nov 20 18:23:16 mymac.atmysite.de mymac[29739]: User user4 has still 11 processes running, kill them NOW.

Nov 20 18:23:16 mymac.atmysite.de mymac[29756]: User user5 has still 2 processes running, trying to stop them NOW.

Nov 20 18:23:19 mymac.atmysite.de mymac[29770]: User user5 has still 2 processes running, kill them NOW.


As you can see - it take about 3 seconds to stop the processes for one user (the sleep period in my script)


No I try to move a few local users back to the server.


Bye,

Christoph

Nov 28, 2015 12:15 AM in response to Christoph Ewering1

Hello Christoph


As more threads this Issue gets, as more I think it is an Issue which has to do with a "german-language based system". In the script I found your comment and can locate your company as based in Germany (Paderborn)


I don't know if your system runs in German or English, but maybe is not the Language the source of the problem but the kind of Keyboard-Settings (Input-Sources or Formats). What I suggest is maybe this settings prevent the system of running the correct logout scripts.


Also I would thank you for your efforts on going to the bottom of this issue. But i have some additional question

1) Is your script planned to run on every client or to start it manualy from one particular machine

2) Is their a way to implement it on every running client without having a lot of scripting or programming experience


Thanks

Gérard

Nov 28, 2015 4:43 AM in response to Robert Hrovat

Hello Robert!


I saw that when my script kills the mdworker processes for a user these process are started again by the system but in my expierences these mdworker processes stop after a few seconds or minutes - so no problem.

Why they are started by the system even thought the user logged out - I do not know - this is something Apple should sort out.


I just checked a system where i had installed my script - you are right I found two processes for ever user that had logged in and out since the last reboot

1. /usr/sbin/distnoted agent

2. /usr/sbin/cfprefsd agent


Very strange - maybe the time between "kill -15" and "kill -9" should be increased so the system does not start processes automatically?


I still do not no if my script solve the problem with the keychain.


But for my understanding there should be no user process when the user logs out.


Bye

Christoph

Mavericks Server Keychain not properly storing information network users.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.