Coder.comC
Coder.com13mo ago
17 replies
Martí

coder_agent shutdown / coder_script run_on_stop not working

Hi,

I'm creating a set of script to run on start and stop. Start scripts run as expected, but run_on_stop scripts (or shutdown) not executing, there is my code
resource "coder_script" "manage_account" {
  ...
  run_on_stop  = true
  run_on_start = true
  script = templatefile("${path.module}/templates/manage_account.tpl", {
    ...
  })
  log_path = "/full_home/tmp/manage_account_${data.coder_workspace.me.transition}.log"
}

I found the /full_home/tmp/manage_account_start.log, but not stop log, and stop action is not executed.

Any idea with this?

Thanks!
Solution
https://github.com/coder/envbox/pull/134
Shutdown scripts were indeed broken, they should be fixed with this PR
Was this page helpful?