@@ -0,0 +1,14 @@ | |||
[Unit] | |||
Description=Diaspora social network (sidekiq) | |||
PartOf=diaspora.target | |||
StopWhenUnneeded=true | |||
[Service] | |||
User={{ diaspora.user.username }} | |||
Environment=RAILS_ENV={{ diaspora.configuration.server.rails_environment }} | |||
WorkingDirectory={{ diaspora.install_path }} | |||
ExecStart=/bin/bash -lc "bin/bundle exec sidekiq" | |||
Restart=always | |||
[Install] | |||
WantedBy=diaspora.target |
@@ -0,0 +1,14 @@ | |||
[Unit] | |||
Description=Diaspora social network (unicorn) | |||
PartOf=diaspora.target | |||
StopWhenUnneeded=true | |||
[Service] | |||
User={{ diaspora.user.username }} | |||
Environment=RAILS_ENV={{ diaspora.configuration.server.rails_environment }} | |||
WorkingDirectory={{ diaspora.install_path }} | |||
ExecStart=/bin/bash -lc "bin/bundle exec unicorn -c config/unicorn.rb -E {{ diaspora.configuration.server.rails_environment }}" | |||
Restart=always | |||
[Install] | |||
WantedBy=diaspora.target |
@@ -1,15 +0,0 @@ | |||
[Unit] | |||
Description=A privacy aware distributed social network | |||
{%- if diaspora.install_redis %} | |||
Wants={{ diaspora.redis_service }}.service | |||
{%- endif %} | |||
[Service] | |||
User={{ diaspora.user.username }} | |||
Environment=RAILS_ENV={{ diaspora.configuration.server.rails_environment }} | |||
WorkingDirectory={{ diaspora.install_path }} | |||
ExecStart=/bin/bash -lc "script/server" | |||
Restart=on-failure | |||
[Install] | |||
WantedBy=multi-user.target |
@@ -0,0 +1,9 @@ | |||
[Unit] | |||
Description=Diaspora social network | |||
{%- if diaspora.install_redis %} | |||
Wants={{ diaspora.redis_service }}.service | |||
After={{ diaspora.redis_service }}.service | |||
{%- endif %} | |||
[Install] | |||
WantedBy=multi-user.target |
@@ -4,21 +4,54 @@ include: | |||
- diaspora.install | |||
- diaspora.config | |||
/etc/systemd/system/diaspora.service: | |||
/etc/systemd/system/diaspora-sidekiq.service: | |||
file.managed: | |||
- user: root | |||
- mode: 644 | |||
- source: salt://diaspora/files/diaspora.service | |||
- source: salt://diaspora/files/diaspora-sidekiq.service | |||
- template: jinja | |||
- context: | |||
diaspora: {{ diaspora|json }} | |||
/etc/systemd/system/diaspora-web.service: | |||
file.managed: | |||
- user: root | |||
- mode: 644 | |||
- source: salt://diaspora/files/diaspora-web.service | |||
- template: jinja | |||
- context: | |||
diaspora: {{ diaspora|json }} | |||
/etc/systemd/system/diaspora.target: | |||
file.managed: | |||
- user: root | |||
- mode: 644 | |||
- source: salt://diaspora/files/diaspora.target | |||
- template: jinja | |||
- context: | |||
diaspora: {{ diaspora|json }} | |||
diaspora_sidekiq_service: | |||
service.enabled: | |||
- name: diaspora-sidekiq | |||
- requre: | |||
- file: /etc/systemd/system/diaspora-sidekiq.service | |||
diaspora_web_service: | |||
service.enabled: | |||
- name: diaspora-web | |||
- requre: | |||
- file: /etc/systemd/system/diaspora-web.service | |||
diaspora_service: | |||
service.running: | |||
- name: diaspora | |||
- name: diaspora.target | |||
- enable: True | |||
- requre: | |||
- cmd: diaspora_precompile_assets | |||
- file: /etc/systemd/system/diaspora.target | |||
- service: diaspora_sidekiq_service | |||
- service: diaspora_web_service | |||
- watch: | |||
- git: diaspora_git | |||
- file: {{ diaspora.install_path }}/config/database.yml |