    # File lib/chef/daemon.rb, line 101
          def save_pid_file
            file = pid_file
            begin
              FileUtils.mkdir_p(File.dirname(file))
            rescue Errno::EACCES => e
              Chef::Application.fatal!("Failed store pid in #{File.dirname(file)}, permission denied: #{e.message}")
            end

            begin
              File.open(file, "w") { |f| f.write(Process.pid.to_s) }
            rescue Errno::EACCES => e
              Chef::Application.fatal!("Couldn't write to pidfile #{file}, permission denied: #{e.message}")
            end
          end