9 Replies Latest reply: Mar 29, 2013 8:17 AM by Mr Tea
Paul Corr1 Level 1 Level 1 (0 points)

This is driving me nuts. I have a MacMini (10.7.4) shutting down each night at 11 PM and restarting at 6 AM. Occasionally (and every day this week), I see the message, "there is a user sharing this computer" when it cannot shut down. Is there a way I can find out which computer it is? I am on a home LAN with three Macs and one PC. I picked up the AFPStatus app but it doesn't help. At the moment, it shows "File Sharing (enabled)" but no IP address of an attached computer. (It has done so on occasion, but not today.)

 

I have File Sharing enabled but limited to certain accounts. (I mention this because Internet research on this mostly says, 'turn File Sharing off".) In Sharing control panel > File Sharing > Options, I see "number of users connected: 1".

 

I have an Apple TV in the living room for the TV, connected via Ethernet. Occasionally, I watch iTunes TV shows from this computer. iTunes is not running this morning and Apple TV is sleeping. So, it shouldn't be the sharing device.

 

There has to be some way to determine which computer is connected for sharing to this Mac. Any suggestions?


Mac mini, Mac OS X (10.7.4)
  • Paul Corr1 Level 1 Level 1 (0 points)

    Continuing my research...

     

    Mac 101: File Sharing is here:

    http://support.apple.com/kb/HT1549

     

    but it does not answer my question.

  • Frank Caggiano Level 7 Level 7 (25,695 points)

    You write that AFPStatus is no help, what do you mean? Is it not showing anything connected or an IP address?

     

    Are you using both AFP and SMB?

     

     

    Have you tried shutting down orr disconnecting each piece of equipment in turn to see if the users connected count drops to 0? If so the piece of equipment you just turned off is connected.

  • Paul Corr1 Level 1 Level 1 (0 points)

    AFPStatus showed File Sharing (enabled). It did not show an IP address while the Sharing control panel showed 1 connection under File Sharing > Options. I see I have both AFP and SMB enabled in that window.

     

    The simple fix is uncheck File Sharing in the Sharing control panel. That throws everyone off. Re-enabling I then see "0 users connected" in that window.

     

    If I walk to another Mac and connect to this Mac, I show 1 user connected on this Mac. AFPStatus shows it also. If I eject the drive connection on the other Mac using the sidebar, returning to this Mac shows 0 users connected after a few moments. I also hear AFPStatus dinging away with the changes.

     

    So, things seem to be working well now. AFPStatus shows the IP when the other Mac is connected, etc.

     

    By the way, I seem to remember--probably prior to OS X--that one could disconnect a user from a file sharing monitor window. That facility seems to be gone.

     

    I'm not sure why sometimes it works as expected and other times the remote user stays connected somehow. This Mac was not on that Mac's desktop as a drive at the time. (I have show network drives enabled in Finder prefs.)

  • Paul Corr1 Level 1 Level 1 (0 points)

    By the way, the AFPStatus "Show Log" option will display a Console log showing incoming connections, close connections, IP and MAC hardware address. All are handy for troubleshooting. I will check there first next time. When I opened it earlier, it had minimal information but it might not have been active. Not sure.

  • Gnarlodious Level 4 Level 4 (3,225 points)

    Applications using a file reference to your computer can mount a remote disk automatically, as long as the computer is on the network. A command like

    netstat -na | grep 548
    

    will list what machine and user is connected by AFP.

  • Paul Corr1 Level 1 Level 1 (0 points)

    Much appreciated! There always seems to be a command-line string that can get you what you want. This, along with AFPStatus after activating logging, will go a long way to troubleshooting more quickly. I have a list of the MAC hardware addresses of our various devices and following the 'netstat' string with 'arp -a' gives me a list to find out who's who. Thanks again.

  • Gnarlodious Level 4 Level 4 (3,225 points)

    Since you found that useful and gave me points to hit 3,000, here is another tip for advanced OSX users. Open Applescript Editor>Preferences and enable Script Menu in the Menubar. Bring Terminal to the front and click the script menu icon and select the top item "Open Scripts Folder" then "Open Terminal Scripts Folder".

    Screen Shot 2012-08-01 at 10.24.41 PM.png

     

    Notice that a new folder will be created for Terminal scripts, which pops open empty. You can do this for any application. This menu is contextual, meaning it changes with whatever application is frontmost. Put an Applescript in this folder containing text like

     

    tell application "Terminal"

              if not (exists window 1) then do script ""

              do script "netstat -na | grep 548" in front window

    end tell


    Call the script "LAN AFP users.scpt" and put it in that folder. Now you have a convenient way to run the command whenever Terminal is in front. You can clone the script with whatever commands you want, and even make subfolders for a very thorough menu. I have a "Network" submenu containing 31 Applescripts. You can even put text files in the menu. Great Mac feature!

     

    -- Gnarlie

  • Paul Corr1 Level 1 Level 1 (0 points)

    Very handy. It's nice to have an example of a command-line script in an AppleScript. It's been awhile since I used that. As you say, a great feature of the OS.

  • Mr Tea Level 1 Level 1 (120 points)

    That gets a 'like' from me, Gnarly. Greetings from a former AS List regular.