Ubic
Ubic copied to clipboard
Improve cached/non-cached status checks for non-root users
Currently, you have to be root to be able to check service status, even if service is coded in such fashion that this isn't really necessary. 'ubic status' command hints about this:
Not a root, printing cached statuses
There are several options how to improve current behavior:
- allow non-root status command to run $service->status() method, and recommend service authors to make their checks simple enough to run from every user (but this will not be possible in all cases - imagine a service binded on local unix socket with chmod 600); cached status can be keeped as well, via "ubic status --cached", for example;
- let service authors to specify whether their status checks require root access, and fallback to a cached status only when it's necessary;
- implement some daemon which would run status checks from root point of view; this role could be performed by ubic-ping, but ubic-ping is currently single-threaded, and i'm unsure if additional dependencies to full-blown http frameworks (Plack or something else) are worth it.
Since 1.27 release, "ubic status" decides on cached/non-cached status for every service separately, and shows non-cached status if "current user" eq "service user". Question about forcing non-cached check in other cases is still open, though.