Hello! I have a little problem with the type service, here is my conf: class ssh{ file{"/etc/ssh/sshd_config": source=>"puppet://myserver/files/config_sshd", notify=>service[sshd] } service{"ssh": name=>"ssh", enable=>true, hasrestart=>true, hasstatus=>false, provider=>debian, pattern=>"sshd", alias=>"sshd", restart=>"/etc/init.d/ssh restart", stop=>"/etc/init.d/ssh stop", ensure=>running } } When I run puppetd on my client, I have the following output, and ssh is running: info: Retrieving plugins info: /File[/var/lib/puppet/lib]/source: No specified sources exist notice: Ignoring cache info: /Service[ssh]: Adding aliases "sshd" info: Caching catalog at /var/lib/puppet/state/localconfig.yaml notice: Starting catalog run err: /Service[ssh]/ensure: change from stopped to running failed: Could not start Service[ssh]: Execution of ''/etc/init.d/ssh start'' returned 256: at /etc/puppet/ssh.pp:18 info: Sent transaction report in 0.06 seconds notice: Finished catalog run in 0.77 seconds Obviously, puppet doesn''t detect that ssh is already running and try to start it. How can make it detect correctly ssh, knowing that ssh process is calling sshd? Greg
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hi Greg, what does ps -ef | grep ssh show you? Phillip Gregoire Galland schrieb:> Hello! > > I have a little problem with the type service, here is my conf: > > class ssh{ > file{"/etc/ssh/sshd_config": > source=>"puppet://myserver/files/config_sshd", > notify=>service[sshd] > } > > service{"ssh": > name=>"ssh", > enable=>true, > hasrestart=>true, > hasstatus=>false, > provider=>debian, > pattern=>"sshd", > alias=>"sshd", > restart=>"/etc/init.d/ssh restart", > stop=>"/etc/init.d/ssh stop", > ensure=>running > } > } > > When I run puppetd on my client, I have the following output, and ssh is > running: > > info: Retrieving plugins > info: /File[/var/lib/puppet/lib]/source: No specified sources exist > notice: Ignoring cache > info: /Service[ssh]: Adding aliases "sshd" > info: Caching catalog at /var/lib/puppet/state/localconfig.yaml > notice: Starting catalog run > err: /Service[ssh]/ensure: change from stopped to running failed: Could > not start Service[ssh]: Execution of ''/etc/init.d/ssh start'' returned > 256: at /etc/puppet/ssh.pp:18 > info: Sent transaction report in 0.06 seconds > notice: Finished catalog run in 0.77 seconds > > Obviously, puppet doesn''t detect that ssh is already running and try to > start it. > How can make it detect correctly ssh, knowing that ssh process is > calling sshd? > > Greg > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHqbSr1MyrzuZeshoRApFoAJ4mlWv0BsZfTx9/TxedfsPngBWZbACfXFaK bXS36EWDADre8EnuFyWoNnI=+VsZ -----END PGP SIGNATURE-----
Hello! Here is the output of the ''ps -ef | grep ssh'' command: 6551 ? 00:00:00 sshd 7374 ? 00:00:00 sshd 7376 ? 00:00:00 sshd Greg Phillip Scholz wrote:> hi Greg, > > what does > > ps -ef | grep ssh > > show you? > > > Phillip > > > Gregoire Galland schrieb: > > Hello! > > > I have a little problem with the type service, here is my conf: > > > class ssh{ > > file{"/etc/ssh/sshd_config": > > source=>"puppet://myserver/files/config_sshd", > > notify=>service[sshd] > > } > > > service{"ssh": > > name=>"ssh", > > enable=>true, > > hasrestart=>true, > > hasstatus=>false, > > provider=>debian, > > pattern=>"sshd", > > alias=>"sshd", > > restart=>"/etc/init.d/ssh restart", > > stop=>"/etc/init.d/ssh stop", > > ensure=>running > > } > > } > > > When I run puppetd on my client, I have the following output, and ssh is > > running: > > > info: Retrieving plugins > > info: /File[/var/lib/puppet/lib]/source: No specified sources exist > > notice: Ignoring cache > > info: /Service[ssh]: Adding aliases "sshd" > > info: Caching catalog at /var/lib/puppet/state/localconfig.yaml > > notice: Starting catalog run > > err: /Service[ssh]/ensure: change from stopped to running failed: Could > > not start Service[ssh]: Execution of ''/etc/init.d/ssh start'' returned > > 256: at /etc/puppet/ssh.pp:18 > > info: Sent transaction report in 0.06 seconds > > notice: Finished catalog run in 0.77 seconds > > > Obviously, puppet doesn''t detect that ssh is already running and try to > > start it. > > How can make it detect correctly ssh, knowing that ssh process is > > calling sshd? > > > Greg > > _______________________________________________ > > Puppet-users mailing list > > Puppet-users@madstop.com > > https://mail.madstop.com/mailman/listinfo/puppet-users >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Gregoire Galland wrote: |> Gregoire Galland schrieb: |>> Hello! |>> I have a little problem with the type service, here is my conf: |>> class ssh{ |>> file{"/etc/ssh/sshd_config": |>> source=>"puppet://myserver/files/config_sshd", |>> notify=>service[sshd] |>> } |>> service{"ssh": |>> name=>"ssh", |>> enable=>true, |>> hasrestart=>true, |>> hasstatus=>false, |>> provider=>debian, |>> pattern=>"sshd", |>> alias=>"sshd", |>> restart=>"/etc/init.d/ssh restart", |>> stop=>"/etc/init.d/ssh stop", |>> ensure=>running |>> } |>> } I think you want: restart=>"/etc/init.d/sshd restart", stop=>"/etc/init.d/sshd stop", Regards James Turnbull - -- James Turnbull (james@lovedthanlost.net) - -- Author of: - - Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) - - Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) - - Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHqcHW9hTGvAxC30ARAvIZAKDGMGF01ZJwA02/cRMXXv+9ByYDHwCfRPKg Qt2UIeexHhK3Hd2ki7tv33Q=YOAG -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Luke Kanies wrote: | On Feb 6, 2008, at 8:19 AM, James Turnbull wrote: | |> I think you want: |> |> restart=>"/etc/init.d/sshd restart", |> stop=>"/etc/init.d/sshd stop", | | | Or just call the service ''sshd''. | Or that - I assumed there was some method to the choice of "ssh" versus "sshd". That way madness lies... James - -- James Turnbull (james@lovedthanlost.net) - -- Author of: - - Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) - - Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) - - Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHqcOk9hTGvAxC30ARAivDAKCvIc+jT+wGYV6SEqF4987RQgxxqQCgtbjs Row3wU22+89GU+NkzqGxg5s=sZLY -----END PGP SIGNATURE-----
On Feb 6, 2008, at 8:19 AM, James Turnbull wrote:> I think you want: > > restart=>"/etc/init.d/sshd restart", > stop=>"/etc/init.d/sshd stop",Or just call the service ''sshd''. -- Finn''s Law: Uncertainty is the final test of innovation. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Gregoire Galland wrote: | On my debian system, to start or stop the sshd daemon, the script is | called ssh(without d at the end). | So the correct path is /etc/init.d/ssh, and puppetd can find it but | raise an error. And puppetd can''t find it in running process, even with | the parameter pattern set to "sshd". | Then you have way too much configured in your service definition. This should work fine for Debian: service { "ssh": ~ enable => true, ~ ensure => running, } Regards James Turnbull - -- James Turnbull (james@lovedthanlost.net) - -- Author of: - - Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) - - Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) - - Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHqcT79hTGvAxC30ARAgmnAJ4wWIfb6fSGQ6sHJxKGUpHM8/fingCgk7En HjLc/wgqQ0oQtLJBB44j++Y=Krzz -----END PGP SIGNATURE-----
On my debian system, to start or stop the sshd daemon, the script is called ssh(without d at the end). So the correct path is /etc/init.d/ssh, and puppetd can find it but raise an error. And puppetd can''t find it in running process, even with the parameter pattern set to "sshd". Because puppet tries to start my ssh service, even if this one is already running, I think there is something wrong how it detects the process... James Turnbull wrote:> Gregoire Galland wrote: > |> Gregoire Galland schrieb: > |>> Hello! > |>> I have a little problem with the type service, here is my conf: > |>> class ssh{ > |>> file{"/etc/ssh/sshd_config": > |>> source=>"puppet://myserver/files/config_sshd", > |>> notify=>service[sshd] > |>> } > |>> service{"ssh": > |>> name=>"ssh", > |>> enable=>true, > |>> hasrestart=>true, > |>> hasstatus=>false, > |>> provider=>debian, > |>> pattern=>"sshd", > |>> alias=>"sshd", > |>> restart=>"/etc/init.d/ssh restart", > |>> stop=>"/etc/init.d/ssh stop", > |>> ensure=>running > |>> } > |>> } > > I think you want: > > restart=>"/etc/init.d/sshd restart", > stop=>"/etc/init.d/sshd stop", > > Regards > > James Turnbull >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Gregoire Galland wrote:> On my debian system, to start or stop the sshd daemon, the script is > called ssh(without d at the end). > So the correct path is /etc/init.d/ssh, and puppetd can find it but > raise an error. And puppetd can''t find it in running process, even with > the parameter pattern set to "sshd".Under Debian etch this works just fine: service { "ssh": ensure => running }
Well, I cleaned up my class and make some tests. If I delete the line hasstatus=>false, then it works fine. Thanks for your help Greg James Turnbull wrote:> Gregoire Galland wrote: > | On my debian system, to start or stop the sshd daemon, the script is > | called ssh(without d at the end). > | So the correct path is /etc/init.d/ssh, and puppetd can find it but > | raise an error. And puppetd can''t find it in running process, even with > | the parameter pattern set to "sshd". > | > Then you have way too much configured in your service definition. This > should work fine for Debian: > > service { "ssh": > ~ enable => true, > ~ ensure => running, > } > > Regards > > James Turnbull >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Gregoire Galland schrieb:> When I run puppetd on my client, I have the following output, and ssh is > running: > > info: Retrieving plugins > info: /File[/var/lib/puppet/lib]/source: No specified sources exist > notice: Ignoring cache > info: /Service[ssh]: Adding aliases "sshd" > info: Caching catalog at /var/lib/puppet/state/localconfig.yaml > notice: Starting catalog run > err: /Service[ssh]/ensure: change from stopped to running failed: Could > not start Service[ssh]: Execution of ''/etc/init.d/ssh start'' returned > 256: at /etc/puppet/ssh.pp:18 > info: Sent transaction report in 0.06 seconds > notice: Finished catalog run in 0.77 seconds > > Obviously, puppet doesn''t detect that ssh is already running and try to > start it. > How can make it detect correctly ssh, knowing that ssh process is > calling sshd?Try running under --debug to see which commands are tried by puppet. That might gitve you a hint about what''S going wrong. Regards, DavidS