Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
Nomad : raw_exec install nginx

I want to run raw_exec to install an nginx , is this possible? or how can this be done by raw_exec only. since this code will not start/run.

job "raw-exec" {
  datacenters = ["dc1"]
  type        = "service"

  group "exec" {
    count = 1

    update {
       max_parallel      = 1
       min_healthy_time  = "10s"
       healthy_deadline  = "5m"
       progress_deadline = "10m"
       auto_revert       = true
     }

    task "raw-exec-test" {
      driver = "raw_exec"

      config {
        command = "/bin/apt"
        args = ["-y", "install", "nginx.service"]
      }

      resources {
        cpu    = 100
        memory = 125
      }

    }
  }
}
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Without a job status it is hard to troubleshoot what's wrong. nomad job status raw-exec would show your job status. It will also show allocations created by the job. You can check what's wrong with the allocations (set of tasks in a job should be run on a particular node) that Nomad creates by nomad alloc status YOUR-ALLOC-ID.

I've run the following Nomad job specification and it worked well on my MacBook. I ran nomad using nomad agent -dev in one terminal window, then created the file test.job in another terminal window and ran nomad job run test.job and it installed htop software on the MacBook.

job "raw-exec" {
  datacenters = ["dc1"]
  type        = "batch"

  group "exec" {
    count = 1

    task "raw-exec-test" {
      driver = "raw_exec"

      config {
        command = "brew"
        args = ["install", "htop"]
      }

      resources {
        cpu    = 100
        memory = 125
      }
    }
  }
}

Notice that I've changed job type from service to batch. Batch jobs are designed to run once while services should be up and running all the time. I suppose that you want your apt install -y nginx command to run only once. You can read more about job types here.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!