gardesk/gardm / 911d641

Browse files

daemon: Remove debug eprintln statements

Remove informational eprintln debug statements that were added during
development. Error messages in session.rs child process are retained
since tracing is not fork-safe and eprintln is the only way to report
errors from the forked child.
Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
911d6413c5529538089d4ef10898c8764e9db9eb
Parents
c6fbe97
Tree
1d8c1b5

2 changed files

StatusFile+-
M gardmd/src/main.rs 0 7
M gardmd/src/session.rs 0 10
gardmd/src/main.rsmodified
@@ -182,13 +182,10 @@ async fn run_display_manager(args: Args, config: Config) -> Result<()> {
182182
             tracing::warn!(error = %e, "Failed to kill greeter");
183183
         }
184184
 
185
-        eprintln!("[MAIN] Greeter session ended, processing result");
186185
         tracing::debug!(?session_result, "Greeter session ended, processing result");
187186
 
188187
         match session_result {
189188
             Ok(Some(session_info)) => {
190
-                eprintln!("[MAIN] Got session_info: {} {:?} ({})",
191
-                    session_info.username, session_info.cmd, session_info.session_type);
192189
                 tracing::info!(
193190
                     "Processing session start: {} {:?} ({})",
194191
                     session_info.username,
@@ -343,14 +340,10 @@ async fn handle_greeter_session(
343340
 
344341
         let (response, session_info) = handle_greeter_request(request, &mut auth).await;
345342
 
346
-        eprintln!("[IPC] About to send response, has_session_info={}", session_info.is_some());
347343
         tracing::debug!(?response, has_session_info = session_info.is_some(), "Sending response to greeter");
348344
         conn.send(&response).await?;
349
-        eprintln!("[IPC] Response sent successfully");
350
-        tracing::debug!("Response sent successfully");
351345
 
352346
         if let Some(info) = session_info {
353
-            eprintln!("[IPC] Returning session info: {} {:?}", info.username, info.cmd);
354347
             tracing::info!(
355348
                 username = %info.username,
356349
                 cmd = ?info.cmd,
gardmd/src/session.rsmodified
@@ -396,9 +396,6 @@ fn child_process_main(
396396
         }
397397
     }
398398
 
399
-    // Execute the session command
400
-    eprintln!("[SESSION] Executing: {} {:?}", cmd_path, cmd_args);
401
-
402399
     // execve replaces the process image
403400
     match nix::unistd::execve(&cmd_cstr, &argv, env_vars) {
404401
         Ok(_) => unreachable!(), // execve doesn't return on success
@@ -419,31 +416,24 @@ fn pam_authenticate_and_open_session(
419416
 ) -> Result<()> {
420417
     // Set environment variables BEFORE creating PAM client
421418
     // pam_systemd reads these to determine session type and VT
422
-    eprintln!("[PAM] Setting environment for pam_systemd: type={}, vt={}", session_type, vt);
423419
     std::env::set_var("XDG_SESSION_TYPE", session_type);
424420
     std::env::set_var("XDG_VTNR", vt.to_string());
425421
     std::env::set_var("XDG_SEAT", "seat0");
426422
     std::env::set_var("XDG_SESSION_CLASS", "user");
427423
 
428
-    eprintln!("[PAM] Creating PAM client for user {}", username);
429
-
430424
     let mut client = Client::with_password(PAM_SERVICE_NAME)
431425
         .map_err(|e| anyhow!("Failed to create PAM client: {:?}", e))?;
432426
 
433427
     client.conversation_mut().set_credentials(username, password);
434428
 
435
-    eprintln!("[PAM] Authenticating...");
436429
     client
437430
         .authenticate()
438431
         .map_err(|e| anyhow!("PAM authentication failed: {:?}", e))?;
439432
 
440
-    eprintln!("[PAM] Opening session...");
441433
     client
442434
         .open_session()
443435
         .map_err(|e| anyhow!("PAM open_session failed: {:?}", e))?;
444436
 
445
-    eprintln!("[PAM] Session opened successfully");
446
-
447437
     // Keep the client alive - don't let it drop and close the session
448438
     // The session will be closed when the process exits
449439
     std::mem::forget(client);