Code review comment for lp:~jamesodhunt/upstart/bug-1315060

Revision history for this message
James Hunt (jamesodhunt) wrote :

... and conversely we want to avoid feeping creaturism - KISS FTW. I'm not convinced that dump-state should be added as a front-end to GetState(): the method is there for those that care, but dumping internal state (particularly in JSON) is not something even an admin needs to do. However, as you say, GetState() does provide an existing way to determine the .conf ordering at runtime.

I think you are right that it isn't appropriate to add --list-confdirs though. That is in fact dangerous since due to the way the option parsing works if that option name is mis-typed, it will be ignored and a new init daemon will attempt to start.

What we could do is tweak init-checkconf as I had originally planned:

https://wiki.ubuntu.com/FoundationsTeam/Specs/RaringUpstartUserSessions#init-checkconf

... except that rather than adding the --list-confdirs option, we can have init-checkconf run GetState(), parse out the conf_dirs and dump them in a readable (non-JSON) format. Might be worth rewriting that script in Python to simplify the JSON parsing though. Another advantage to changing inti-checkconf is that it could also be changed to not spawn a new init and connect to an existing one resulting in a tool that can show the theoretical search path or the actual search path for the running init.

« Back to merge proposal