Module: Chef::Sugar::Init

Extended by:
Init
Included in:
Init
Defined in:
lib/chef/sugar/init.rb

Instance Method Summary collapse

Instance Method Details

#runit?(node) ⇒ Boolean

Determine if the current init system is runit.

Returns:

  • (Boolean)

45
46
47
# File 'lib/chef/sugar/init.rb', line 45

def runit?(node)
  File.executable?('/sbin/runit-init')
end

#systemd?(node) ⇒ Boolean

Determine if the current init system is systemd.

Returns:

  • (Boolean)

27
28
29
# File 'lib/chef/sugar/init.rb', line 27

def systemd?(node)
  File.exist?('/bin/systemctl')
end

#upstart?(node) ⇒ Boolean

Determine if the current init system is upstart.

Returns:

  • (Boolean)

36
37
38
# File 'lib/chef/sugar/init.rb', line 36

def upstart?(node)
  File.executable?('/sbin/initctl')
end