Module: Cognizant::Process::Attributes
- Included in:
- Cognizant::Process
- Defined in:
- lib/cognizant/process/attributes.rb
Instance Attribute Summary collapse
-
#autostart ⇒ true, false
Whether or not to auto start the process when beginning monitoring.
-
#chdir ⇒ String
The current working directory for the process to start with.
-
#chroot ⇒ String
The chroot directory to change the process’ idea of the file system root.
-
#daemonize ⇒ true, false
Whether or not to daemonize the process.
-
#env ⇒ Hash
Environment variables for process.
-
#errfile ⇒ String
The file to log the daemon’s STDERR stream into.
-
#gid ⇒ String
Run the process as the given user group.
-
#group ⇒ String
Group classification for the process.
-
#groups ⇒ Array
Supplementary user groups for the process.
-
#logfile ⇒ String
The file to log the process’ STDOUT stream into.
-
#name ⇒ String
Unique name for the process.
-
#pid_command ⇒ String
The command that returns the pid of the process.
-
#pidfile ⇒ String
The pid lock file for the process.
-
#ping_command ⇒ String
The command to check the running status of the process with.
-
#uid ⇒ String
Run the process as the given user.
-
#umask ⇒ Integer
Limit the permission modes for files and directories created by the process.
Instance Method Summary collapse
Instance Attribute Details
#autostart ⇒ true, false
Whether or not to auto start the process when beginning monitoring. Afterwards, auto start is automatically managed based on user initiated stop or restart requests. Note: For child processes, this value is automatically set to false.
26 27 28 |
# File 'lib/cognizant/process/attributes.rb', line 26 def autostart @autostart end |
#chdir ⇒ String
The current working directory for the process to start with.
62 63 64 |
# File 'lib/cognizant/process/attributes.rb', line 62 def chdir @chdir end |
#chroot ⇒ String
The chroot directory to change the process’ idea of the file system root.
58 59 60 |
# File 'lib/cognizant/process/attributes.rb', line 58 def chroot @chroot end |
#daemonize ⇒ true, false
Whether or not to daemonize the process. It is recommended that cognizant managed your process completely by process not daemonizing itself. Find a non-daemonizing option in your process’ documentation.
19 20 21 |
# File 'lib/cognizant/process/attributes.rb', line 19 def daemonize @daemonize end |
#env ⇒ Hash
Environment variables for process.
53 54 55 |
# File 'lib/cognizant/process/attributes.rb', line 53 def env @env end |
#errfile ⇒ String
The file to log the daemon’s STDERR stream into.
49 50 51 |
# File 'lib/cognizant/process/attributes.rb', line 49 def errfile @errfile end |
#gid ⇒ String
Run the process as the given user group. e.g. “deploy”
77 78 79 |
# File 'lib/cognizant/process/attributes.rb', line 77 def gid @gid end |
#group ⇒ String
Group classification for the process. Note: This is not system process group. See ‘gid` attribute instead.
12 13 14 |
# File 'lib/cognizant/process/attributes.rb', line 12 def group @group end |
#groups ⇒ Array
Supplementary user groups for the process. e.g. [“staff”]
82 83 84 |
# File 'lib/cognizant/process/attributes.rb', line 82 def groups @groups end |
#logfile ⇒ String
The file to log the process’ STDOUT stream into.
45 46 47 |
# File 'lib/cognizant/process/attributes.rb', line 45 def logfile @logfile end |
#name ⇒ String
Unique name for the process. Note: For child processes, this value is set automatically.
7 8 9 |
# File 'lib/cognizant/process/attributes.rb', line 7 def name @name end |
#pid_command ⇒ String
The command that returns the pid of the process.
36 37 38 |
# File 'lib/cognizant/process/attributes.rb', line 36 def pid_command @pid_command end |
#pidfile ⇒ String
The pid lock file for the process. Required when daemonize is set to false.
41 42 43 |
# File 'lib/cognizant/process/attributes.rb', line 41 def pidfile @pidfile end |
#ping_command ⇒ String
The command to check the running status of the process with. The exit status of the command is used to determine the status. e.g. “/usr/bin/redis-cli PING”
32 33 34 |
# File 'lib/cognizant/process/attributes.rb', line 32 def ping_command @ping_command end |
#uid ⇒ String
Run the process as the given user. e.g. “deploy”, 1000
72 73 74 |
# File 'lib/cognizant/process/attributes.rb', line 72 def uid @uid end |
#umask ⇒ Integer
Limit the permission modes for files and directories created by the process.
67 68 69 |
# File 'lib/cognizant/process/attributes.rb', line 67 def umask @umask end |
Instance Method Details
#autostart! ⇒ Object
88 89 90 |
# File 'lib/cognizant/process/attributes.rb', line 88 def autostart! @autostart = true end |
#daemonize! ⇒ Object
84 85 86 |
# File 'lib/cognizant/process/attributes.rb', line 84 def daemonize! @daemonize = true end |
#reset_attributes! ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/cognizant/process/attributes.rb', line 93 def reset_attributes! self.name = nil self.group = nil self.daemonize = true self.autostart = false self.ping_command = nil self.pid_command = nil self.pidfile = nil self.logfile = nil self.errfile = nil self.env = {} self.chroot = nil self.chdir = nil self.uid = nil self.gid = nil self.groups = [] end |