Skip to content

Commit

Permalink
Add docs for signal
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Jul 9, 2017
1 parent 989777a commit fedc392
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions README.md
Expand Up @@ -57,11 +57,12 @@ Or install it yourself as:
* [3.2. Options](#32-options)
* [3.2.1. Current directory](#321-current-directory)
* [3.2.2. Redirection](#322-redirection)
* [3.2.3. Handling input](#323-handling-input)
* [3.2.4. Timeout](#324-timeout)
* [3.2.5. User](#324-user)
* [3.2.6. Group](#325-group)
* [3.2.7. Umask](#326-umask)
* [3.2.3. Handling input](#323-handling-input)
* [3.2.4. Timeout](#324-timeout)
* [3.2.5. Signal](#325-signal)
* [3.2.6. User](#326-user)
* [3.2.7. Group](#327-group)
* [3.2.8. Umask](#328-umask)
* [3.3. Result](#33-result)
* [3.3.1. success?](#331-success)
* [3.3.2. failure?](#332-failure)
Expand Down Expand Up @@ -313,23 +314,31 @@ cmd.run("while test 1; sleep 1; done", timeout: 5)

Please run `examples/timeout.rb` to see timeout in action.

#### 3.2.5 User
#### 3.2.5 Signal

You can specify process termination signal other than the defaut 'SIGTERM':

```ruby
cmd.run("whilte test1; sleep1; done", timeout: 5, signal: :KILL)
```

#### 3.2.6 User

To run command as a given user do:

```ruby
cmd.run(:echo, 'hello', user: 'piotr')
```

#### 3.2.6 Group
#### 3.2.7 Group

To run command as part of group do:

```ruby
cmd.run(:echo, 'hello', group: 'devs')
```

#### 3.2.7 Umask
#### 3.2.8 Umask

To run command with umask do:

Expand Down

0 comments on commit fedc392

Please sign in to comment.