Module: LegacyMixlib::ShellOut::Unix

Included in:
LegacyMixlib::ShellOut
Defined in:
src/mintpress-common/lib/legacymixlib/shellout/unix.rb

Constant Summary collapse

ONE_DOT_EIGHT_DOT_SEVEN =
"1.8.7" as a frozen string. We use this with a hack that disables GC to avoid segfaults on Ruby 1.8.7, so we need to allocate the fewest objects we possibly can.
"1.8.7".freeze

Instance Method Summary collapse

Instance Method Details

#all_seconderies ⇒ Object

Helper method for sgids

#logon_environment ⇒ Object

The environment variables that are deduced from simulating logon Only valid if login is used

#process_environment ⇒ Object

Merges the two environments for the process

#run_command ⇒ Object

Run the command, writing the command's standard out and standard error to +stdout+ and +stderr+, and saving its exit status object to +status+ === Returns returns +self+; +stdout+, +stderr+, +status+, and +exitstatus+ will be populated with results of the command. === Raises * Errno::EACCES when you are not privileged to execute the command * Errno::ENOENT when the command is not available on the system (or not in the current $PATH) * Chef::Exceptions::CommandTimeout when the command does not complete within +timeout+ seconds (default: 600s). When this happens, ShellOut will send a TERM and then KILL to the entire process group to ensure that any grandchild processes are terminated. If the invocation of the child process spawned multiple child processes (which commonly happens if the command is passed as a single string to be interpreted by bin/sh, and bin/sh is not bash), the exit status object may not contain the correct exit code of the process (of course there is no exit code if the command is killed by SIGKILL, also).

#sgids ⇒ Object

The secondary groups that the subprocess will switch to. Currently valid only if login is used, and is set to the user's secondary groups

#using_login? ⇒ Boolean

Whether we're simulating a login shell

Returns:

  • (Boolean)

#validate_options(opts) ⇒ Object

Option validation that is unix specific