Skip to content

Commit 31c3842

Browse files
committed
restore operation order
1 parent ad035d5 commit 31c3842

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src-tauri/src/service/daemon.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,9 @@ pub async fn run_server(config: Config) -> anyhow::Result<()> {
512512
fs::remove_file(DAEMON_SOCKET_PATH)?;
513513
}
514514

515+
debug!("Binding socket file at {DAEMON_SOCKET_PATH}");
516+
let uds = UnixListener::bind(DAEMON_SOCKET_PATH)?;
517+
515518
// change owner group for socket file
516519
// get the group ID by name
517520
let group = Group::from_name(DAEMON_SOCKET_GROUP)?.ok_or_else(|| {
@@ -528,8 +531,6 @@ pub async fn run_server(config: Config) -> anyhow::Result<()> {
528531
debug!("Setting permissions for socket file at {DAEMON_SOCKET_PATH} to 0x660");
529532
fs::set_permissions(DAEMON_SOCKET_PATH, fs::Permissions::from_mode(0o660))?;
530533

531-
debug!("Binding socket file at {DAEMON_SOCKET_PATH}");
532-
let uds = UnixListener::bind(DAEMON_SOCKET_PATH)?;
533534
let uds_stream = UnixListenerStream::new(uds);
534535

535536
info!("Defguard daemon version {VERSION} started, listening on socket {DAEMON_SOCKET_PATH}",);

0 commit comments

Comments
 (0)