Knife ssh 'name:NODE' 'cmd' != ssh NODE 'cmd' (?)

Sorry if that subject line doesn’t parse real well.

We have a mystery with the ‘knife ssh’ command when we use it to deploy one of our Java based services. Our recipe for the service concludes with a “service … action :restart”.

When we run this knife command:
knife ssh ‘name:FQDN’ “sudo chef-client”

We can see our service start, and then it and the Java process stop immediately (in < one second). We are yet to get Java or the service to tell us why they are going away, they just vanish.

If we run an equivalent SSH command:
ssh FQDN “sudo chef-client”

The service starts, and stays started. Why would this make a difference? And is there a way to get Knife to provide us with more information when it does the restart?

Our Chef Server and the managed node are on 0.9.8. I’ve run the above commands from the server and also from a 0.10.0 node with the same results. I also get the same results when I run a script calling the Knife libraries directly.

Any ideas would be appreciated.

Thanks,

Ken Miles
DevOps Engineering
Infogroup, PDX

On Friday, June 3, 2011 at 12:07 PM, Miles, Ken wrote:

Sorry if that subject line doesn't parse real well.

We have a mystery with the 'knife ssh' command when we use it to deploy one of our Java based services. Our recipe for the service concludes with a "service ... action :restart".

When we run this knife command:
knife ssh 'name:FQDN' "sudo chef-client"

We can see our service start, and then it and the Java process stop immediately (in < one second). We are yet to get Java or the service to tell us why they are going away, they just vanish.

If we run an equivalent SSH command:
ssh FQDN "sudo chef-client"

The service starts, and stays started. Why would this make a difference? And is there a way to get Knife to provide us with more information when it does the restart?

Sounds like this is related to process groups/sessions. How do you start this application? At $last_job, I used wrappers such as jsvc to keep Java apps daemonized, since Java itself doesn't support the proper UNIXisms for daemonizing.

--
Dan DeLeo

Our Chef Server and the managed node are on 0.9.8. I've run the above commands from the server and also from a 0.10.0 node with the same results. I also get the same results when I run a script calling the Knife libraries directly.

Any ideas would be appreciated.

Thanks,

Ken Miles
DevOps Engineering
Infogroup, PDX

We are using 'yajsw' (Yet Another Java Service Wrapper). The 'start' line in the init.d script is:

eval ""java" "-Dwrapper.pidfile=/var/run/wrapper.yajsw.${w_name}.pid" "-Dwrapper.service=true" "-Dwrapper.visible=false" "-jar" "$yajsw_home/wrapper.jar" "-tx" "$wrapper_conf" "

I did crank up the logging level in Knife to 'debug' and got more information, although I still don't see why it dies.

I will dig further into yajsw as I'm able.

Thanks,

Ken Miles

-----Original Message-----
From: Daniel DeLeo [mailto:ddeleo@kallistec.com] On Behalf Of Daniel DeLeo
Sent: Friday, June 03, 2011 12:13 PM
To: chef@lists.opscode.com
Subject: [chef] Re: knife ssh 'name:NODE' 'cmd' != ssh NODE 'cmd' (?)

On Friday, June 3, 2011 at 12:07 PM, Miles, Ken wrote:

Sorry if that subject line doesn't parse real well.

We have a mystery with the 'knife ssh' command when we use it to deploy one of our Java based services. Our recipe for the service concludes with a "service ... action :restart".

When we run this knife command:
knife ssh 'name:FQDN' "sudo chef-client"

We can see our service start, and then it and the Java process stop immediately (in < one second). We are yet to get Java or the service to tell us why they are going away, they just vanish.

If we run an equivalent SSH command:
ssh FQDN "sudo chef-client"

The service starts, and stays started. Why would this make a difference? And is there a way to get Knife to provide us with more information when it does the restart?

Sounds like this is related to process groups/sessions. How do you start this application? At $last_job, I used wrappers such as jsvc to keep Java apps daemonized, since Java itself doesn't support the proper UNIXisms for daemonizing.

--
Dan DeLeo

Our Chef Server and the managed node are on 0.9.8. I've run the above commands from the server and also from a 0.10.0 node with the same results. I also get the same results when I run a script calling the Knife libraries directly.

Any ideas would be appreciated.

Thanks,

Ken Miles
DevOps Engineering
Infogroup, PDX