4

I've just installed OS X Server. Whenever I try to shut it down (as a local interactive user), I keep seeing a prompt that requires me to enter an admin's name and password before proceeding with the shutdown:

Shutting down may cause other users logged into this computer to lose unsaved changes.

OS X Server shutdown prompt

I keep seeing this dialog even though there is nobody else connected to the machine.

Question is, how can I disable this dialog? I mean, let anybody who is logged in locally to shutdown the machine without entering an administrator password (or even without entering their own password?) I see this is not a security issue since with physical access, they can just press the power button.

My original intention is to use the living room's iMac as an Xcode build server, primarily to run unit tests. The machine starts and automatically logs in to a non-privileged account to make it convenient for people to use it to play videos and such. It would be nice to have this machine run unit tests as well, and it's really not critical if a build/run gets canceled mid-way because the machine is shutting down.

Server version: 4.1 (14S1092)
OS X: 10.10.3 (14D136)

  • 1
    While there may not be any other people logged in to your machine, there are other logged in users. Issuing the command 'who -a' in Terminal.app will reveal their identities. – Doc G. Jul 22 '15 at 16:15
  • @DocG. Yes, the Xcode CI's _xcodebuildd user is logged in. The question is about how to ignore these "system" users when shutting down and just let it go as per normal. – adib Aug 13 '15 at 14:16
1

One possible way could be by using a terminal command:

shutdown -h now

This immediately kills all processes and shuts your system down in a fairly nice manner.

As a normal user you could initiate this by

sudo shutdown -h now

But the problem with password prompt remains, this time in the terminal.

Having a closer look to the sudo configuration file /etc/sudoers I found:

...
# User privilege specification
root    ALL=(ALL) ALL
%admin  ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
# %wheel        ALL=(ALL) ALL

# Same thing without a password
# %wheel        ALL=(ALL) NOPASSWD: ALL
...

Check whether your account is already in the wheel or admin group by issueing groups in the terminal. If that is the case, just uncomment the line with %wheel NOPASSWD or by adding NOPASSWD at the proper position of the admin line above (the wheel line shows you how to do this). For instance:

tatooine-3:~ mallert$ groups
staff com.apple.sharepoint.group.2 everyone localaccounts _appserverusr
admin _appserveradm _lpadmin _appstore _lpoperator _developer
com.apple.access_screensharing com.apple.access_ssh com.apple.sharepoint.group.1

Here my user is already in the admin group, therefore I would just add NOPASSWD in the sudoers line like this:

%admin  ALL=(ALL) NOPASSWD ALL

Now you should be able to fire up a

sudo shutdown -h now

without being asked for a password. To finalize my solution you could create an app with automator which executes this sudo shutdown -k now command as a bash script.

If you want to reboot the server instead, use

sudo shutdown -r now
0

Its just simple just delete the server application from applications and install it again and do not create any other local server in it and it will be solved

  • Hi, welcome to Ask Different. Please add sources and context that explain how your solution solves the question asked by the OP. – Jaime Santa Cruz Jul 3 '15 at 21:47
0

One thing to try if there is only one user logged in is, logging that user out which would then return to the login screen. From the login screen there is a "Shutdown" button. Choosing "Shutdown" from there would, hopefully, complete since there are (theoretically) no more users logged in.

If that doesn't work then you are going to have to create a script that uses the 'shutdown' or 'halt' commands to force the system to shutdown. You may need to look at the man pages for those commands but 'shutdown -h' or 'halt' should work. However, those commands need to be run with admin privileges in order to function properly. So if you want anyone to be able to run the script (not just admins) then you will need to put it somewhere that is accessible to all user accounts and give the file admin privileges.

If you have to go the script route then I would try to get the 'shutdown' command to work first, since it is the safer way to shut down your system. The 'halt' command is a bit brutal in the way that it kills off apps and shuts the system down.

0

Holding down the option key while selecting Shut Down (or Restart) from the Apple menu will bypass the Dialog Box and cause the action to occur immediately.

0

I experienced exactly the same problem and successfully solved it recently.

Yes, this is caused by server.app. To be exact, it is due to you linked you Xcode in your server.app enter image description here

In this way, your server is running Xcode in the background, and hence the prompt when you attempt to shut you computer. Using command line interface to shut would not change the situation.

Interestingly, once you "Choose Xcode to begin" here, there is no option to disconnect Xcode here. Switching off in the upper right corner would not help, even uninstalling server.app thoroughly would not help either.

Fortunately, the solution is as easy as two commands:

sudo xcrun xcscontrol --shutdown
sudo xcrun xcscontrol --reset

Here is how I found this: I looked through the Activity Monitor for processes with suspicious usernames, and noticed a user named "_xcscouch". By search "xcscouch mac", I found the following answer and it solved my problem. I Installed Server.app on Yosemite to enable caching, but see many server processes in Task Manager (_xcsbuild and _devicemgr and _calendar processes)

  • 1
    There are about 30-40 "other" users (= system accounts like _www). It's not wise to delete one of them due to its "strange" name. – klanomath Sep 7 '15 at 4:31
  • The question is to disable the shutdown prompt and not to erase system accounts used by the server. That is, it's OK to shut down even when there are system users being logged in. In normal installations, there are also other users logged in, e.g. _spotlight, _locationd and others but the system shuts down just fine. – adib Sep 7 '15 at 13:03
-1

There must be more than one users logged on your computer, you'd better log out users after a certain time limit.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .