Code review comment for lp:~xnox/upstart/user-log-dir

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

OK, you've convinced me on paths.h :-)

I've updated the spec such that we have a script which sets the appropriate XDG vars if not already set *and* creates them if they don't exist. It will then start the Session Init. However, I wonder if the Session Init should also attempt to create the directories returned by xdg_get_cache_home() and xdg_get_config_home() to handle the scenario that a user logs in multiple times and in the first session say deletes one or both of these directories.

I think that to be conformant to the XDG spec, the alluded-to script can as Dmitrijs says run 'initctl list-sessions' and if that returns nothing, remove XDG_RUNTIME_DIR before exiting.

After scrutinizing the XDG spec again, we do need to make some minor changes:

* init/xdg.c:
  - xdg_get_cache_home(): This must check that if XDG_CACHE_HOME is set that it also is an absolute path before we use it.
  - xdg_get_config_home(): Same logic as above for XDG_CONFIG_HOME.
  - get_user_upstart_dirs(): Same logic for XDG_CONFIG_DIRS.

« Back to merge proposal