Expose a default system dependent PID file + domain socket location for mongocryptd

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Expose functions like:

      const char*
      mongocrypt_default_pid_file_path (void);
      
      const char*
      mongocrypt_default_domain_socket_path (void);
      

      Which returns the default PID file path a driver should use to spawn and connect to mongocryptd.

      mark.benvenuto helpfully suggested the base logic per system:

      MacOS

      NSTemporaryDirectory()/mongocryptd.pid
      https://developer.apple.com/documentation/foundation/1409211-nstemporarydirectory  
      

      Linux

      if $XDG_RUNTIME_DIR set:
         $XDG_RUNTIME_DIR/mongocryptd.pid
      else if $XDG_DATA_HOME is set
        $XDG_DATA_HOME/mongocryptd.pid
      else if $HOME
          $HOME/.local/share/mongocryptd.pid
      else
         abort
      https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html  
      

      Windows

      %LOCALAPPDATA%\Temp\mongocryptd.pid 
      
      Via FOLDERID_LocalAppData i.e. (%LOCALAPPDATA% (%USERPROFILE%\AppData\Local))
      https://docs.microsoft.com/en-us/windows/desktop/shell/knownfolderid
      

              Assignee:
              Unassigned
              Reporter:
              Kevin Albertson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: