I need to write a configuration file that is owned by root/wheel.
Either I need to somehow have my stand alone web app run as root or I need to be able to pop up a dialog box and ask for an administrator users name and password when necessary.
Popping up a dialog box is easy, but I believe there must be a Mac/Linux way of doing this.
Once you have the user name and password is the text used to feed a sudo command…
Any details on this processes?
Use launchd on Mac. The services on Linux vary based on distro.
But DONT do this. It basically gives the outside world root access to your server. If somebody find a vulnerability, they can do incredible damage. Instead, create a group, run your app from the group, and ensure the group has write access file(s) in question.
Don’t run it as root? Agreed…
So there are two applications involved in this… the server and the client…
neither should be root but both should belong to the same group?
Server and client are on the same machine? I’m not sure how to advise you in this case. Not sure what you’re trying to do.
I have two servers that run on one machine.
but one of the servers runs as root/wheel and the other does not.
Therefore the one that does not can not share configuration files with the other.