Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Tyagov
slapos
Commits
a725eecb
Commit
a725eecb
authored
May 24, 2017
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
5af1d94a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
20 deletions
+59
-20
software/apache-frontend/buildout.hash.cfg
software/apache-frontend/buildout.hash.cfg
+9
-5
software/apache-frontend/common.cfg
software/apache-frontend/common.cfg
+3
-0
software/apache-frontend/instance-apache-frontend.cfg
software/apache-frontend/instance-apache-frontend.cfg
+17
-11
software/apache-frontend/templates/apache-custom-slave-list.cfg.in
...apache-frontend/templates/apache-custom-slave-list.cfg.in
+4
-1
software/apache-frontend/templates/apache-graceful-script.sh.in
...re/apache-frontend/templates/apache-graceful-script.sh.in
+21
-0
software/apache-frontend/templates/apache-lazy-script-call.sh.in
...e/apache-frontend/templates/apache-lazy-script-call.sh.in
+5
-3
No files found.
software/apache-frontend/buildout.hash.cfg
View file @
a725eecb
...
@@ -19,7 +19,7 @@ md5sum = f686f765e55d1dce2e55a400f0714b3e
...
@@ -19,7 +19,7 @@ md5sum = f686f765e55d1dce2e55a400f0714b3e
[template-apache-frontend]
[template-apache-frontend]
filename = instance-apache-frontend.cfg
filename = instance-apache-frontend.cfg
md5sum =
ea599162be999680cd43d4605762219f
md5sum =
86f9ace5eb5ac28dbc173e1803952f03
[template-apache-replicate]
[template-apache-replicate]
filename = instance-apache-replicate.cfg.in
filename = instance-apache-replicate.cfg.in
...
@@ -27,7 +27,7 @@ md5sum = 9b17c835bcd927269cf510bf612f5985
...
@@ -27,7 +27,7 @@ md5sum = 9b17c835bcd927269cf510bf612f5985
[template-slave-list]
[template-slave-list]
filename = templates/apache-custom-slave-list.cfg.in
filename = templates/apache-custom-slave-list.cfg.in
md5sum =
5d9ac851493534c90397d453497c21b4
md5sum =
4010f7366262d00c33f9e7f53f63d42e
[template-slave-configuration]
[template-slave-configuration]
filename = templates/custom-virtualhost.conf.in
filename = templates/custom-virtualhost.conf.in
...
@@ -43,7 +43,7 @@ md5sum = 070658d10546b5a69fe291e0da876e62
...
@@ -43,7 +43,7 @@ md5sum = 070658d10546b5a69fe291e0da876e62
[template-custom-slave-list]
[template-custom-slave-list]
filename = templates/apache-custom-slave-list.cfg.in
filename = templates/apache-custom-slave-list.cfg.in
md5sum =
5d9ac851493534c90397d453497c21b4
md5sum =
4010f7366262d00c33f9e7f53f63d42e
[template-not-found-html]
[template-not-found-html]
filename = templates/notfound.html
filename = templates/notfound.html
...
@@ -93,6 +93,10 @@ md5sum = a5186f666acb2f040ede04c91e60408f
...
@@ -93,6 +93,10 @@ md5sum = a5186f666acb2f040ede04c91e60408f
filename = templates/nginx-notebook-slave.conf.in
filename = templates/nginx-notebook-slave.conf.in
md5sum = 82d74a7f2aceb2b4a7acc6259291b7f2
md5sum = 82d74a7f2aceb2b4a7acc6259291b7f2
[template-apache-lazy-script-call
.sh.in
]
[template-apache-lazy-script-call]
filename = templates/apache-lazy-script-call.sh.in
filename = templates/apache-lazy-script-call.sh.in
md5sum = f519bea5b54448c5ad486c4ef6c0fb23
md5sum = f94ba895196706c80a19b2981e2a1c5a
[template-apache-graceful-script]
filename = templates/apache-graceful-script.sh.in
md5sum = 6541deeee97730c8a032b70a7a6e89a0
software/apache-frontend/common.cfg
View file @
a725eecb
...
@@ -145,6 +145,9 @@ mode = 0644
...
@@ -145,6 +145,9 @@ mode = 0644
<=download-template
<=download-template
filename = apache-lazy-script-call.sh.in
filename = apache-lazy-script-call.sh.in
[template-apache-graceful-script]
<=download-template
filename = apache-graceful-script.sh.in
[template-nginx-eventsource-slave-virtualhost]
[template-nginx-eventsource-slave-virtualhost]
<=download-template
<=download-template
...
...
software/apache-frontend/instance-apache-frontend.cfg
View file @
a725eecb
...
@@ -172,8 +172,6 @@ extra-context =
...
@@ -172,8 +172,6 @@ extra-context =
key nginx_configuration_directory apache-directory:nginx-slave-configuration
key nginx_configuration_directory apache-directory:nginx-slave-configuration
key apache_cached_configuration_directory apache-directory:slave-with-cache-configuration
key apache_cached_configuration_directory apache-directory:slave-with-cache-configuration
key slave_with_cache_configuration_directory apache-directory:slave-with-cache-configuration
key slave_with_cache_configuration_directory apache-directory:slave-with-cache-configuration
key cached_port apache-configuration:cache-through-port
key ssl_cached_port apache-configuration:ssl-cache-through-port
key http_port instance-parameter:configuration.plain_http_port
key http_port instance-parameter:configuration.plain_http_port
key https_port instance-parameter:configuration.port
key https_port instance-parameter:configuration.port
key nginx_http_port instance-parameter:configuration.plain_nginx_port
key nginx_http_port instance-parameter:configuration.plain_nginx_port
...
@@ -185,7 +183,6 @@ extra-context =
...
@@ -185,7 +183,6 @@ extra-context =
key apache_log_directory apache-directory:slave-log
key apache_log_directory apache-directory:slave-log
key local_ipv4 instance-parameter:ipv4-random
key local_ipv4 instance-parameter:ipv4-random
key global_ipv6 slap-network-information:global-ipv6
key global_ipv6 slap-network-information:global-ipv6
key cache_port apache-configuration:cache-port
key varnginx directory:varnginx
key varnginx directory:varnginx
key empty_template software-release-path:template-empty
key empty_template software-release-path:template-empty
key template_custom_slave_configuration software-release-path:template-slave-configuration
key template_custom_slave_configuration software-release-path:template-slave-configuration
...
@@ -194,6 +191,7 @@ extra-context =
...
@@ -194,6 +191,7 @@ extra-context =
key template_eventsource_slave_configuration software-release-path:template-nginx-eventsource-slave-virtualhost
key template_eventsource_slave_configuration software-release-path:template-nginx-eventsource-slave-virtualhost
key template_notebook_slave_configuration software-release-path:template-nginx-notebook-slave-virtualhost
key template_notebook_slave_configuration software-release-path:template-nginx-notebook-slave-virtualhost
raw software_type single-custom-personal
raw software_type single-custom-personal
key frontend_lazy_graceful_reload frontend-apache-lazy-graceful:rendered
section logrotate_dict logrotate
section logrotate_dict logrotate
section frontend_configuration frontend-configuration
section frontend_configuration frontend-configuration
section apache_configuration apache-configuration
section apache_configuration apache-configuration
...
@@ -372,7 +370,7 @@ name = apache
...
@@ -372,7 +370,7 @@ name = apache
log = $${apache-configuration:error-log} $${apache-configuration:access-log}
log = $${apache-configuration:error-log} $${apache-configuration:access-log}
frequency = daily
frequency = daily
rotatep-num = 30
rotatep-num = 30
post = $${
apache-configuration:frontend-graceful-command}
post = $${
frontend-apache-lazy-graceful:rendered} &
sharedscripts = true
sharedscripts = true
notifempty = true
notifempty = true
create = true
create = true
...
@@ -500,26 +498,34 @@ mode = 700
...
@@ -500,26 +498,34 @@ mode = 700
### End of ATS sections
### End of ATS sections
### Apaches Graceful and promises
### Apaches Graceful and promises
[frontend-apache-graceful]
[frontend-apache-graceful
-bin
]
< = jinja2-template-base
< = jinja2-template-base
template = ${template-wrapper:output}
template = ${template-wrapper:output}
rendered = $${directory:
etc-ru
n}/frontend-apache-safe-graceful
rendered = $${directory:
bi
n}/frontend-apache-safe-graceful
mode = 0700
mode = 0700
extra-context =
extra-context =
key content apache-configuration:frontend-graceful-command
key content apache-configuration:frontend-graceful-command
[frontend-apache-graceful]
< = jinja2-template-base
template = ${template-apache-graceful-script:target}
rendered = $${directory:etc-run}/frontend-apache-safe-graceful
mode = 0700
extra-context =
key directory_run directory:run
key directory_etc directory:etc
key apache_graceful_reload_command apache-configuration:frontend-graceful-command
[frontend-apache-lazy-graceful]
[frontend-apache-lazy-graceful]
< = jinja2-template-base
< = jinja2-template-base
template = ${template-apache-lazy-script-call:
outpu
t}
template = ${template-apache-lazy-script-call:
targe
t}
rendered = $${directory:bin}/frontend-apache-lazy-graceful
rendered = $${directory:bin}/frontend-apache-lazy-graceful
mode = 0700
mode = 0700
pid-file = $${directory:run}/lazy-graceful.pid
extra-context =
extra-context =
key pid_file :pid-file
raw wait_time 60
raw wait_time 60
key content apache-configuration:frontend-graceful-command
key lazy_command apache-configuration:frontend-graceful-command
# Promises checking configuration:
# Promises checking configuration:
[promise-frontend-apache-configuration]
[promise-frontend-apache-configuration]
...
...
software/apache-frontend/templates/apache-custom-slave-list.cfg.in
View file @
a725eecb
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
{% set cached_server_dict = {} -%}
{% set cached_server_dict = {} -%}
{% set part_list = [] -%}
{% set part_list = [] -%}
{% set cache_port = apache_configuration.get('cache-port') %}
{% set cached_port = apache_configuration.get('cache-through-port') %}
{% set ssl_cached_port = apache_configuration.get('ssl-cache-through-port') %}
{% set cache_access = "http://%s:%s" % (local_ipv4, cache_port) -%}
{% set cache_access = "http://%s:%s" % (local_ipv4, cache_port) -%}
{% set ssl_cache_access = "http://%s:%s/HTTPS" % (local_ipv4, cache_port) -%}
{% set ssl_cache_access = "http://%s:%s/HTTPS" % (local_ipv4, cache_port) -%}
{% set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%}
{% set TRUE_VALUES = ['y', 'yes', '1', 'true'] -%}
...
@@ -27,7 +30,7 @@ context =
...
@@ -27,7 +30,7 @@ context =
{{ key }} = {{ value }}
{{ key }} = {{ value }}
{% endfor %}
{% endfor %}
post = {{
apache_configuration.get('frontend-graceful-command') }}
post = {{
frontend_lazy_graceful_reload }} &
frequency = daily
frequency = daily
rotatep-num = 30
rotatep-num = 30
sharedscripts = true
sharedscripts = true
...
...
software/apache-frontend/templates/apache-graceful-script.sh.in
0 → 100644
View file @
a725eecb
#!/bin/sh
RUN_DIR
={{
directory_run
}}
ETC_DIR
={{
directory_etc
}}
APACHE_SIGNATURE_FILE
=
$RUN_DIR
/apache_configuration.signature
NAPACHE_SIGNATURE_FILE
=
$RUN_DIR
/napache_configuration.signature
touch
$APACHE_SIGNATURE_FILE
sha256sum
$ETC_DIR
/apache
*
.conf
$ETC_DIR
/apache-
*
.d/
*
.conf |
sort
-k
66
>
$NAPACHE_SIGNATURE_FILE
# If no diff, no restart for now
if
diff
"
$APACHE_SIGNATURE_FILE
"
"
$NAPACHE_SIGNATURE_FILE
"
;
then
echo
"Nothing Changed, so nothing to reload"
exit
0
fi
echo
"Reloading apache.."
{{
apache_graceful_reload_command
}}
mv
"
$NAPACHE_SIGNATURE_FILE
"
"
$APACHE_SIGNATURE_FILE
"
software/apache-frontend/templates/apache-lazy-script-call.sh.in
View file @
a725eecb
#!/bin/bash
#!/bin/bash
PID
=
$$
PID
=
$$
PIDFILE
=
~/my.pid
PIDFILE
=
{{
pid_file
}}
if
[
!
-f
$PIDFILE
]
;
then
if
[
!
-f
$PIDFILE
]
;
then
echo
$PID
>>
$PIDFILE
echo
$PID
>
$PIDFILE
sleep
{{
wait_time
}}
{{
lazy_command
}}
else
else
ps
--pid
`
cat
$PIDFILE
`
&>/dev/null
ps
--pid
`
cat
$PIDFILE
`
&>/dev/null
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
echo
"Skipped"
echo
"Skipped"
else
else
echo
$PID
>
>
$PIDFILE
echo
$PID
>
$PIDFILE
sleep
{{
wait_time
}}
sleep
{{
wait_time
}}
{{
lazy_command
}}
{{
lazy_command
}}
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment