Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

puppet_webhook does not start #10

Closed
Dan33l opened this issue Dec 18, 2018 · 1 comment
Closed

puppet_webhook does not start #10

Dan33l opened this issue Dec 18, 2018 · 1 comment

Comments

@Dan33l
Copy link
Member

Dan33l commented Dec 18, 2018

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.8 AIO
  • Ruby:
  • Distribution: ubuntu 16.06
  • Module version: 1.0.0

How to reproduce (e.g Puppet code you use)

  class { 'puppetwebhook' :
    pkg_provider  => 'gem',
    server_cfg    => {
      server_type => 'daemon',
      host        => $facts['networking']['ip'],
      logfile     => '/var/log/puppet_webhook/webhook.log',
      loglevel    => 'WARN',
      pidfile     => '/var/run/webhook.pid',
      port        => 8088,
      enable_ssl  => false,

    },
    webhook_user  => 'puppet',
    webhook_group => 'puppet',
  }

What are you seeing

puppet apply hang on command /bin/systemctl start puppet_webhook and the process does not start.

What behaviour did you expect instead

Output log

Debug output:

Debug: Prefetching gem resources for package
Debug: Executing: '/usr/bin/gem list --local'
Debug: Prefetching puppet_gem resources for package
Debug: Executing: '/opt/puppetlabs/puppet/bin/gem list --local'
Debug: Prefetching apt resources for package
Debug: Executing '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n''
Debug: Executing: '/bin/systemctl is-active puppet_webhook'
Debug: Executing: '/bin/systemctl is-enabled puppet_webhook'
Debug: Executing: '/bin/systemctl unmask puppet_webhook'
Debug: Executing: '/bin/systemctl start puppet_webhook'

And hang here.

Any additional information you'd like to impart

The systemd unit is:

[Unit]
Description=R10K Webhook Service
After=syslog.target network.target

[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/webhook
RuntimeDirectory=puppet_webhook
User=puppet
TimeoutStartSec=90
TimeoutStopSec=30
RestartSec=10000

ExecStart=/opt/puppetlabs/puppet/bin/puppet_webhook -c /etc/puppet_webhook/server.yml
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
StandardOutput=syslog

[Install]
WantedBy=multi-user.target

But the file is in /usr/local/bin/puppet_webhook.
On Debian like systems it should be EnvironmentFile=-/etc/default/webhook

@Dan33l
Copy link
Member Author

Dan33l commented Dec 20, 2018

In the class call, they are two problems.

Firstly, it is defined server_type => 'daemon', and so the process puppet_webhook daemonize.
But the systemd unit is with Type=simple (not forking), so systemd expects something that does not daemonize.

Secondly, it is defined pkg_provider => 'gem',, but systemd unit use /opt/puppetlabs/puppet/bin/puppet_webhook and so it is needed to use provider puppet_gem instead of gem.

I close the issue so.

@Dan33l Dan33l closed this as completed Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant