def self.apache2ctl_V(options = nil)
if options
apache2ctl = options[:apache2ctl] || self.apache2ctl(options)
else
apache2ctl = self.apache2ctl
end
if os_name_simple == "linux" &&
linux_distro_tags.include?(:gentoo) &&
apache2ctl == "/usr/sbin/apache2ctl"
if options
httpd = options[:httpd] || self.httpd(options)
else
httpd = self.httpd
end
version_command = httpd
else
version_command = apache2ctl
end
if version_command
create_temp_file("apache2ctl_V") do |filename, f|
e_filename = Shellwords.escape(filename)
output = `#{version_command} -V 2>#{e_filename}`
if $? && $?.exitstatus == 0
stderr_text = File.open(filename, "rb") do |f2|
f2.read
end
stderr_text.sub!(/.*Could not reliably determine the server's fully qualified domain name.*\r?\n?/, "")
STDERR.write(stderr_text)
STDERR.flush
output
else
nil
end
end
else
nil
end
end