rolo 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -18
  3. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b3806b450a0536de04c8055092336df4a1dbf111
4
- data.tar.gz: 70ba13a0e41597b54f6c761f6177203bac02336a
3
+ metadata.gz: 82ea3f5c3cee515188ac61aa8a6beb901c6004b0
4
+ data.tar.gz: 07ef8d73ea6442cc998bb67732370542189ffa2b
5
5
  SHA512:
6
- metadata.gz: 8268958f0d0f52c5e464c9fcd67ada9a71207d0dcb5688707d4b39b164ba49c14312d9ebe0f9fee054fbc1d2a41cc4fbfc46c1eafd60505e99d0d07a0f5bd4ff
7
- data.tar.gz: 3ae4a61457272801745033df6ac35fcbd6844bf36837a7bacb587689e7c8426f7f5c9caf7fcff68ccdc9c5f475a987ba5424251a6029350ad91a7f02443d1c67
6
+ metadata.gz: 7ff13f29f79c69cfc1192e51846b5969e55abe0fb6e839feaa3a41ae1432d77de4295d3c1a542cb355969fc2116edcee27011646702a0af360f3415b309e11bc
7
+ data.tar.gz: 1f27e193943af59075b20005f0a2be6ccc8bcbda22a546cb20585734b15d4b9e329cb3c4d857738b3a8714cf3f294afc1f1f41b40ed99bbaa1cf9ba51e445434
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
+ [![Build Status](https://travis-ci.org/icy/rolo.svg?branch=master)](https://travis-ci.org/icy/rolo)
2
+
1
3
  ## NAME
2
4
 
3
- `rolo.rb` -- Prevents a program from running more than one copy at a time
5
+ `rolo` -- Prevents a program from running more than one copy at a time
4
6
 
5
7
  ## SYNOPSIS
6
8
 
@@ -12,7 +14,7 @@
12
14
  checking if there is a network socket that is open by the application
13
15
  and/or by `rolo`.
14
16
 
15
- `rolo.rb` prevents a program from running more than one copy at a time;
17
+ `rolo` prevents a program from running more than one copy at a time;
16
18
  it is useful with cron to make sure that a job doesn't run before a
17
19
  previous one has finished. `robo.rb` is a ruby version of Timothy
18
20
  program <https://github.com/timkay/solo> with some more options.
@@ -40,16 +42,16 @@
40
42
  the port is open by another program and it will only check if that port
41
43
  is open or not. Otherwise, see below.
42
44
 
43
- Before starting your `<command>` (using `exec`), `rolo.rb` will open a
45
+ Before starting your `<command>` (using `exec`), `rolo` will open a
44
46
  socket on a local address (or address specified by option `--address`.)
45
47
  This socket will be closed after your command exits, and as long as
46
48
  your command is running, we have a chance to check its status by
47
- checking the status of this socket. If it is still open when `rolo.rb`
48
- is invoked, `rolo.rb` exits without invoking a new instance of command.
49
+ checking the status of this socket. If it is still open when `rolo`
50
+ is invoked, `rolo` exits without invoking a new instance of command.
49
51
 
50
52
  However, if your `<command>` closes all file descriptors at the time it
51
- is executed, `rolo.rb` will be sucked. (See `EXAMPLE` for details and for
52
- a trick when using `rolo.rb` with `ssh`.) If that the cases, you may
53
+ is executed, `rolo` will be sucked. (See `EXAMPLE` for details and for
54
+ a trick when using `rolo` with `ssh`.) If that the cases, you may
53
55
  use the option `--address` and `--port` to specify a socket that your
54
56
  command binds on.
55
57
 
@@ -57,7 +59,7 @@
57
59
 
58
60
  Here are some simple examples and applications. Feel free to contribute.
59
61
 
60
- ### Create SSH tunnels
62
+ ### Create SSH tunnels (OpenSSH older than 5.6p1)
61
63
 
62
64
  To create tunnel to a remote server, you can use this ssh command
63
65
 
@@ -70,46 +72,58 @@
70
72
 
71
73
  To keep this tunnel persistent, you can add this to your crontab
72
74
 
73
- rolo.rb -p 4567 \
75
+ rolo -p 4567 \
74
76
  ssh remote -fNL localhost:1234:localhost:10000
75
77
 
76
- and allows this line to be executed once every 5 minutes. `rolo.rb`
78
+ and allows this line to be executed once every 5 minutes. `rolo`
77
79
  will check if your ssh command is still running. If 'yes', it will
78
- simply exit; if 'no', `rolo.rb` will start the ssh command.
80
+ simply exit; if 'no', `rolo` will start the ssh command.
79
81
 
80
82
  ### With OpenSSH 5.6p1 or later
81
83
 
82
84
  However, if you use *OpenSSH 5.6p1* (or later), `ssh` will close all file
83
85
  descriptors from the parent (except for `STDIN`, `STDOUT` and `STDERR`).
84
- As the socket opened by `rolo.rb` is closed, `rolo.rb` will always
86
+ As the socket opened by `rolo` is closed, `rolo` will always
85
87
  start new instance of the `ssh` tunnel. (Actually I had process `bomb`
86
88
  on my system when I used the original program `solo` to launch my
87
89
  tunnels.)
88
90
 
89
91
  Fortunately, `ssh` has option to bind on the local address.
90
- Using this option we can trick `rolo.rb` as below
92
+ Using this option we can trick `rolo` as below
91
93
 
92
- rolo.rb -p 4567 \
94
+ rolo -p 4567 \
93
95
  ssh remote -fN \
94
96
  -L localhost:1234:localhost:10000 \
95
97
  -L %address:%port:localhost:12345
96
98
 
97
99
  The last use of option `-L` will ask `ssh` to open a socket on
98
- `%address:%port` (the real values will be provided by `rolo.rb`),
99
- and it will be checked by `rolo.rb` in its next run. Please note that
100
+ `%address:%port` (the real values will be provided by `rolo`),
101
+ and it will be checked by `rolo` in its next run. Please note that
100
102
  we use a random port `12345` to prevent local connections to
101
103
  `%address:%port` from being forwarded to remote.
102
104
 
103
105
  Another way is to use option `--address`
104
106
 
105
- rolo.rb -p 1234 -a 127.0.0.1 \
107
+ rolo -p 1234 -a 127.0.0.1 \
106
108
  ssh remote -fNL localhost:1234:localhost:10000
107
109
 
108
110
  And this is another way
109
111
 
110
- rolo.rb -p 1234 -a 127.0.0.1 \
112
+ rolo -p 1234 -a 127.0.0.1 \
111
113
  ssh remote -fNL %address:%port:localhost:10000
112
114
 
115
+ ### Create ssh tunnels: the cleanest way
116
+
117
+ Within the `--no-bind` option, you can event do something cleaner
118
+
119
+ rolo --no-bind -p 1234 -a 127.0.0.1 \
120
+ ssh remote -fN -L localhost:1234:localhost:10000
121
+
122
+ Because `ssh` would listen on the local port `1234`, we may just ask
123
+ `rolo` to check if that port is open. If `yes`, it's sure that our
124
+ tunnel is running and `rolo` will simply exit. Otherwise, `ssh` may
125
+ exit and `rolo` will start new `ssh` tunnel.
126
+
113
127
  ### Start VirtualBox guests
114
128
 
115
129
  To make sure that your VirtualBox Windows guest is always running,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anh K. Huynh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-14 00:00:00.000000000 Z
11
+ date: 2017-08-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Start an application and/or prevent it from running twice by simply checking
14
14
  if there is a network socket that is open by the application and/or by `rolo`
@@ -22,7 +22,7 @@ files:
22
22
  - bin/rolo
23
23
  homepage: https://github.com/icy/rolo
24
24
  licenses:
25
- - GPL v2
25
+ - GPL-2.0
26
26
  metadata: {}
27
27
  post_install_message:
28
28
  rdoc_options: []
@@ -30,18 +30,18 @@ require_paths:
30
30
  - lib
31
31
  required_ruby_version: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - '>='
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: '0'
36
36
  required_rubygems_version: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  requirements: []
42
42
  rubyforge_project:
43
- rubygems_version: 2.0.3
43
+ rubygems_version: 2.6.11
44
44
  signing_key:
45
45
  specification_version: 4
46
- summary: '`rolo` prevents a program from running more than one copy at a time'
46
+ summary: "`rolo` prevents a program from running more than one copy at a time"
47
47
  test_files: []