Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
[Xgrid] xgridctl as root
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xgrid] xgridctl as root



Hi everyone (particularly Apple folks),

After being out of the loop for a while, I finally got around to getting XgridLite working on Leopard. (Test version about to be posted at code.edbaskerville.com, official release probably by Monday.)

In doing so, I ran into one weirdness that I thought someone might be able to explain. XgridLite simply calls xgridctl to get and set controller state, which seems simple enough. In Tiger, it was sufficient to do this as root using a setuid tool.

In Leopard, however, I found that status calls always returned that the controller was off:

daemon              state               pid
======              =====               ===
xgridcontrollerd    stopped

This was happening inside the setuid tool even when querying it via sudo as a regular user worked fine:

Agnos:~ ebaskerv$ sudo xgridctl c status
daemon              state               pid
======              =====               ===
xgridcontrollerd    running             12656

To get to the bottom of this, I activated the root user on my system and tried it from a root shell, and, sure enough, I'm being told the controller is stopped:

sh-3.2# xgridctl c status
daemon              state               pid
======              =====               ===
xgridcontrollerd    stopped

Miraculously, though, if you run xgridctl via sudo as root, all is fine:

sh-3.2# sudo xgridctl c status
daemon              state               pid
======              =====               ===
xgridcontrollerd    running             12656

This gave me the workaround I needed: run xgridctl via sudo as root inside XgridLite. But I still have no idea *why* this is happening, so I'm writing purely out of curiosity. Why is it that running xgridctl status via sudo gives the correct status, while running as root directly does not? One more wrinkle: running xgridctl c start/stop seem to work fine inside my setuid tool (WITHOUT running via sudo), but do NOT work via a root shell!

Any wisdom would be appreciated.

Thanks,
Ed
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xgrid-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.