upstart-exporter 0.1.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md
CHANGED
@@ -25,6 +25,7 @@ The export process is configured through the only config, /etc/upstart-exporter.
|
|
25
25
|
|
26
26
|
---
|
27
27
|
run_user: www # The user under which all installed through upstart-exporter background jobs are run
|
28
|
+
run_group: www # The group of run_user
|
28
29
|
helper_dir: /var/helper_dir # Auxilary directory for scripts incapsulating background jobs
|
29
30
|
upstart_dir: /var/upstart_dir # Directory where upstart scripts should be placed
|
30
31
|
prefix: 'myupstartjobs-' # Prefix added to app's log folders and upstart scripts
|
@@ -6,6 +6,7 @@ module Upstart::Exporter::Options
|
|
6
6
|
'helper_dir' => '/var/local/upstart_helpers/',
|
7
7
|
'upstart_dir' => '/etc/init/',
|
8
8
|
'run_user' => 'service',
|
9
|
+
'run_group' => 'service',
|
9
10
|
'prefix' => 'fb-'
|
10
11
|
}
|
11
12
|
|
@@ -20,7 +21,7 @@ module Upstart::Exporter::Options
|
|
20
21
|
{}
|
21
22
|
end
|
22
23
|
error "#{CONF} is not a valid YAML config" unless config.is_a?(Hash)
|
23
|
-
|
24
|
+
DEFAULTS.keys.each do |param|
|
24
25
|
value = if config[param]
|
25
26
|
config[param]
|
26
27
|
else
|
@@ -30,6 +30,8 @@ pre-start script
|
|
30
30
|
bash << "EOF"
|
31
31
|
mkdir -p /var/log/{{app_name}}
|
32
32
|
chown -R {{run_user}} /var/log/{{app_name}}
|
33
|
+
chgrp -R {{run_group}} /var/log/{{app_name}}
|
34
|
+
chmod -R g+w /var/log/{{app_name}}
|
33
35
|
EOF
|
34
36
|
|
35
37
|
end script
|
@@ -43,6 +45,8 @@ respawn
|
|
43
45
|
script
|
44
46
|
touch /var/log/{{app_name}}/{{cmd_name}}.log
|
45
47
|
chown {{run_user}} /var/log/{{app_name}}/{{cmd_name}}.log
|
48
|
+
chgrp {{run_group}} /var/log/{{app_name}}/{{cmd_name}}.log
|
49
|
+
chmod g+w /var/log/{{app_name}}/{{cmd_name}}.log
|
46
50
|
exec sudo -u {{run_user}} /bin/sh {{helper_cmd_conf}} >> /var/log/{{app_name}}/{{cmd_name}}.log 2>&1
|
47
51
|
end script
|
48
52
|
HEREDOC
|
@@ -10,12 +10,14 @@ pre-start script
|
|
10
10
|
bash << "EOF"
|
11
11
|
mkdir -p /var/log/SOMEAPP
|
12
12
|
chown -R SOMEUSER /var/log/SOMEAPP
|
13
|
+
chgrp -R SOMEGROUP /var/log/SOMEAPP
|
14
|
+
chmod -R g+w /var/log/SOMEAPP
|
13
15
|
EOF
|
14
16
|
|
15
17
|
end script
|
16
18
|
HEREDOC
|
17
19
|
|
18
|
-
described_class.app(:run_user => 'SOMEUSER', :app_name => 'SOMEAPP').should == conf
|
20
|
+
described_class.app(:run_user => 'SOMEUSER', :run_group => 'SOMEGROUP', :app_name => 'SOMEAPP').should == conf
|
19
21
|
end
|
20
22
|
end
|
21
23
|
|
@@ -46,11 +48,13 @@ respawn
|
|
46
48
|
script
|
47
49
|
touch /var/log/SOMEAPP/SOMECMD.log
|
48
50
|
chown SOMEUSER /var/log/SOMEAPP/SOMECMD.log
|
51
|
+
chgrp SOMEGROUP /var/log/SOMEAPP/SOMECMD.log
|
52
|
+
chmod g+w /var/log/SOMEAPP/SOMECMD.log
|
49
53
|
exec sudo -u SOMEUSER /bin/sh HELPERPATH >> /var/log/SOMEAPP/SOMECMD.log 2>&1
|
50
54
|
end script
|
51
55
|
HEREDOC
|
52
56
|
|
53
|
-
described_class.command(:run_user => 'SOMEUSER', :app_name => 'SOMEAPP', :cmd_name => 'SOMECMD', :helper_cmd_conf => 'HELPERPATH').should == conf
|
57
|
+
described_class.command(:run_user => 'SOMEUSER', :run_group => 'SOMEGROUP', :app_name => 'SOMEAPP', :cmd_name => 'SOMECMD', :helper_cmd_conf => 'HELPERPATH').should == conf
|
54
58
|
end
|
55
59
|
end
|
56
60
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upstart-exporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
|
-
- 0
|
8
7
|
- 1
|
9
|
-
-
|
10
|
-
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ilya Averyanov
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-02-
|
18
|
+
date: 2012-02-21 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: Gem for converting Procfile-like files to upstart scripts
|