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

SysV init script leaves dangling shell processes #293

Closed
cryptomeme opened this issue Feb 10, 2019 · 0 comments · Fixed by #502
Closed

SysV init script leaves dangling shell processes #293

cryptomeme opened this issue Feb 10, 2019 · 0 comments · Fixed by #502

Comments

@cryptomeme
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.3.3
  • Ruby: 2.4.2
  • Distribution: CentOS 6.10
  • Module version: 6.4.0

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

class profile_prometheus::node (
  String $version = '0.17.0'
) {
  $init_style = $::os['distro']['release']['major'] ? {
    '6'     => 'sysv',
    '7'     => 'systemd',
    default => fail('Do not know which init_style is appropriate for prometheus node exporter')
  }

  class { '::prometheus::node_exporter':
    version    => $version,
    init_style => $init_style,
    collectors => ['diskstats','filefd','filesystem','loadavg','meminfo','netdev','stat','time','uname','vmstat']
  }
}

What are you seeing

The shell for the sysv-style init script never terminates, leaving extra shells running in the process tree

What behaviour did you expect instead

node_exporter would have a parent process id of '1' after starting successfully.

Output log

pstree -a output on CentOS 6.10

init─┬─atd
     ├─node_exporter /etc/init.d/node_exporter start
  │   └─runuser -s /bin/bash node-exporter -c...
  │       └─bash -c...
  │           └─node_exporter...
  │               ├─{node_exporter}
  │               ├─{node_exporter}
  │               ├─{node_exporter}
  │               ├─{node_exporter}
  │               ├─{node_exporter}
  │               ├─{node_exporter}
  │               ├─{node_exporter}
  │               └─{node_exporter}

Any additional information you'd like to impart

On CentOS 7.6.1810 w/ systemd, the PPID is 1 (systemd) as expected:

  systemd --switched-root --system --deserialize 22
  ├─node_exporter
  │   └─7*[{node_exporter}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant