Giter Club home page Giter Club logo

Comments (6)

biemond avatar biemond commented on September 25, 2024

Hi ,

that is indeed much better than a sleep. Hope you will send me a pull request

thanks

from biemond-orawls.

adamjk-dev avatar adamjk-dev commented on September 25, 2024

Unfortunately, I am not currently allowed to submit to open source projects, that is the bad part of this.

from biemond-orawls.

biemond avatar biemond commented on September 25, 2024

Ok, no problem.

I think this can work https://github.com/fiddyspence/puppet-sleep

but I am only thinking checking for a running process is not enough, the first time can take a while, probably need to check with netstat if the nodemanager is listening on that port

from biemond-orawls.

adamjk-dev avatar adamjk-dev commented on September 25, 2024

Very cool, that looks (by description) to be exactly what I was referring to. I like it a lot!

from biemond-orawls.

biemond avatar biemond commented on September 25, 2024

This will be the code

sleep is a parameter you can set your own value, default = 20 and will check for every 2 seconds

exec { "startNodemanager ${title}":
  command     => "nohup ${startHome}/startNodeManager.sh &",
  environment => [ $env, "JAVA_HOME=${jdk_home_dir}", 'JAVA_VENDOR=Oracle' ],
  unless      => $checkCommand,
  path        => $exec_path,
  user        => $os_user,
  group       => $os_group,
  cwd         => $nodeMgrHome,
}

sleep { "wake up ${title}":
  bedtime       => $sleep,
  wakeupfor     => "/bin/netstat -lnt | /bin/grep ':${nodemanager_port}'",
  dozetime      => 2,
  failontimeout => true,
  subscribe     => Exec["startNodemanager ${title}"],
  refreshonly   => true,
}

from biemond-orawls.

adamjk-dev avatar adamjk-dev commented on September 25, 2024

Very good, sir! The only other question would be whether or not you want to make the dozetime configurable (not that it buys you a whole lot really). But, this is definitely very nice.

from biemond-orawls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.