Class AutomateIt::AccountManager::NSCD
In: lib/automateit/account_manager/nscd.rb
Parent: ::AutomateIt::AccountManager::BaseDriver

AccountManager::NSCD

AccountManager driver for invalidating records stored in the NSCD, Name Service Cache Daemon, found on Unix-like systems.

Methods

Public Instance methods

Returns the NSCD database for the specified shorthand query.

[Source]

# File lib/automateit/account_manager/nscd.rb, line 16
  def database_for(query)
    case query.to_sym
    when :user, :users, :passwd, :password
      :passwd
    when :group, :groups
      :group
    else
      raise ArgumentError.new("Unknown cache database: #{query}")
    end
  end

Invalidates the NSCD database, thus forcing a cache reload.

[Source]

# File lib/automateit/account_manager/nscd.rb, line 28
  def invalidate(database)
    return false unless available?

    interpreter.sh("nscd -i #{database_for(database)}")
  end

[Validate]