Skip to content

Commit

Permalink
add logs path
Browse files Browse the repository at this point in the history
  • Loading branch information
matifali committed Sep 26, 2023
1 parent 1d00015 commit 81817ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions kasmvnc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ variable "timezone" {
default = "Etc/UTC"
}

variable "log_path" {
type = string
description = "Path to store KasmVNC logs."
default = "~/.kasmvnc/kasmvnc.log"
}

resource "coder_script" "kasm_vnc" {
agent_id = var.agent_id
display_name = "KasmVNC"
Expand All @@ -52,6 +58,7 @@ resource "coder_script" "kasm_vnc" {
PORT : var.port,
DESKTOP_ENVIRONMENT : var.desktop_environment,
VERSION : var.custom_version,
LOG_PATH : var.log_path,
LOCALE : var.locale,
TIMEZONE : var.timezone
})
Expand Down
4 changes: 3 additions & 1 deletion kasmvnc/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,6 @@ EOF'
echo -e "password\npassword\n" | vncpasswd -wo -u $USER

# Start the server :)
sudo -u $USER bash -c "vncserver -select-de \"${DESKTOP_ENVIRONMENT}\" -disableBasicAuth -interface 0.0.0.0"
sudo -u $USER bash -c "vncserver -kill $DISPLAY &> ${LOG_PATH} || sudo rm -rfv /tmp/.X*-lock /tmp/.X11-unix" \
|| echo "no locks present"
sudo -u $USER bash -c "vncserver -select-de \"${DESKTOP_ENVIRONMENT}\" -disableBasicAuth -interface 0.0.0.0 >${LOG_PATH} 2>&1 &"

0 comments on commit 81817ed

Please sign in to comment.