This file is indexed.

/usr/sbin/mcollectived is in mcollective 2.6.0+dfsg-2.1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env ruby

# For security reasons, ensure that '.' is not on the load path
# This is primarily for 1.8.7 since 1.9.2+ doesn't put '.' on the load path
$LOAD_PATH.delete '.'

require 'mcollective'
require 'getoptlong'

opts = GetoptLong.new(
  [ '--daemonize', GetoptLong::NO_ARGUMENT],
  [ '--no-daemonize', GetoptLong::NO_ARGUMENT],
  [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
  [ '--config', '-c', GetoptLong::REQUIRED_ARGUMENT],
  [ '--pidfile', '-p', GetoptLong::REQUIRED_ARGUMENT]
)

daemonize = nil

if MCollective::Util.windows?
  configfile = File.join(MCollective::Util.windows_prefix, "etc", "server.cfg")
else
  configfile = "/etc/mcollective/server.cfg"
end
pid = ""

opts.each do |opt, arg|
  case opt
    when '--help'
      puts "Usage: mcollectived.rb [--config /path/to/config] [--pidfile /path/to/pid] [--daemonize | --no-daemonize]"
      exit
    when '--config'
      configfile = arg
    when '--pidfile'
      pid = arg
    when '--daemonize'
      daemonize = true
    when '--no-daemonize'
      daemonize = false
  end
end

config = MCollective::Config.instance

config.loadconfig(configfile) unless config.configured

# If daemonize has not been set on the cli, reach into the config file to decide
if daemonize == nil
  daemonize = config.daemonize
end

MCollective::Log.info("The Marionette Collective #{MCollective::VERSION} started logging at #{config.loglevel} level")

if daemonize
  MCollective::Log.debug("Starting in the background (#{config.daemonize})")

  if MCollective::Util.windows?
    require 'mcollective/windows_daemon'
    MCollective::WindowsDaemon.daemonize_runner
  else
    require 'mcollective/unix_daemon'
    MCollective::UnixDaemon.daemonize_runner(pid)
  end
else
  MCollective::Log.debug("Starting in the foreground")
  runner = MCollective::Runner.new(configfile)
  runner.main_loop
end