Ask Your Question
0

Java server timeout - command which never returns exit code

asked 2013-10-03 03:00:15 -0600

George gravatar image

Hi,

I run an exec command which starts a Java server from a Jar file. The problem is that the command never exit with a code (because the process will run until it will be shut down). When I try to run the exec as part of a Puppet manifest, I receive a timeout on that (which is normal). I've tried to modify the command in order to run the process as a daemon (with setsid) and it works, but If the server will start with an error, I cannot see the output(because it was forked). There are ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-10-03 09:41:12 -0600

ryanbrooks gravatar image

updated 2013-10-03 11:28:35 -0600

GregLarkin gravatar image

I would package the JAR as an application for your system (e.g. a .deb for Ubuntu) with its associated init script and PID. then you can use package and service, e.g.

package{'myservice': 
  ensure => present, 
  before => Service['myservice'] 
}
service{'myservice': 
  ensure => running 
}

This way your init script can return information about whether it has started successfully or not.

A good way to look at it is that Puppet is there to manage the state of your system. There are mature tools for managing software installation (deb, rpm, etc.), which are more suited to the problem you're trying ... (more)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-10-03 03:00:15 -0600

Seen: 148 times

Last updated: Oct 03 '13