
Working With Unix Processes

The same thing, with places reversed! ENV['MESSAGE'] = 'wing it' system "echo $MESSAGE"
Jesse Storimer • Working With Unix Processes
You can use these same methods to check and modify limits on other system resources. Some common ones are: # The maximum number of simultaneous processes # allowed for the current user. Process.getrlimit(:NPROC) # The largest size file that may be created. Process.getrlimit(:FSIZE) # The maximum size of the stack segment of the # process. Process.g
... See moreJesse Storimer • Working With Unix Processes
You can see that we set a new limit for the number of open files, and upon asking for that limit again both the hard limit and the soft limit were set to the new value 4096. We can optionally pass a third argument to Process.setrlimit specifying a new hard limit as well, assuming we have the permissions to do so. Note that lowering the hard limit,
... See moreJesse Storimer • Working With Unix Processes
Every process has access to a special array called ARGV. Other programming languages may implement it slightly differently, but every one has something called 'argv'. argv is a short form for 'argument vector'. In other words: a vector, or array, of arguments. It holds the arguments that were passed in to the current process on the command line. He
... See moreJesse Storimer • Working With Unix Processes
Every process running on your system has a unique process identifier, hereby referred to as 'pid'.
Jesse Storimer • Working With Unix Processes
Every process on the system has a name. For example, when you start up an irb session that process is given the name 'irb'. The neat thing about process names is that they can be changed at runtime and used as a method of communication. In Ruby you can access the name of the current process in the $PROGRAM_NAME variable. Similarly, you can assign a
... See moreJesse Storimer • Working With Unix Processes
there are many sections to the Unix manpages. Here's a look at the most commonly used sections of the manpages for FreeBSD and Linux systems: Section 1: General Commands Section 2: System Calls Section 3: C Library Functions Section 4: Special Files So Section 1 is for general commands (a.k.a. shell commands). If I wanted to refer you to the manual
... See moreJesse Storimer • Working With Unix Processes
What's the difference? Glad you asked. The soft limit isn't really a limit. Meaning that if you exceed the soft limit (in this case by opening more than 2560 resources at once) an exception will be raised, but you can always change that limit if you want
Jesse Storimer • Working With Unix Processes
any code that is executed happens inside a process.