parent
e0bcc3ef3e
commit
29959730f5
15 changed files with 93 additions and 41 deletions
@ -1,10 +1,17 @@ |
||||
--- |
||||
|
||||
- name: Start and enable the services |
||||
service: name={{ item }} state=started enabled=yes |
||||
with_items: |
||||
- name: Start and enable services |
||||
service: name={{ item }} state=started enabled=True |
||||
loop: |
||||
- seafile |
||||
- seahub |
||||
when: seafile_install_mode != 'upgrade' # We need to run upgrade script manually |
||||
tags: seafile |
||||
|
||||
- name: Start and enable timers |
||||
systemd: name={{ item }}.timer state=started enabled=True |
||||
loop: |
||||
- seafile-clean-db |
||||
- seafile-gc |
||||
tags: seafile |
||||
|
||||
|
@ -0,0 +1,10 @@ |
||||
#!/bin/sh |
||||
|
||||
set -eo pipefail |
||||
|
||||
PATH=/opt/seafile/bin:/bin:/usr/bin |
||||
PYTHONPATH=/opt/seafile/lib64/python3.6/site-packages/ |
||||
PYTHON=/opt/seafile/bin/python |
||||
cd {{ seafile_root_dir }}/seafile-server |
||||
./seahub.sh python-env python3 seahub/manage.py clearsessions |
||||
|
@ -1,11 +1,9 @@ |
||||
#!/bin/sh |
||||
|
||||
{% if seafile_license is not defined %} |
||||
/usr/bin/systemctl stop seafile |
||||
/usr/bin/systemctl stop seahub |
||||
/usr/bin/systemctl stop seafile seahub |
||||
{% endif %} |
||||
/usr/bin/systemd-cat /usr/bin/sudo -u {{ seafile_user }} {{ seafile_root_dir }}/seafile-server/seaf-gc.sh |
||||
{% if seafile_license is not defined %} |
||||
/usr/bin/systemctl start seafile |
||||
/usr/bin/systemctl start seahub |
||||
/usr/bin/systemctl start seafile seahub |
||||
{% endif %} |
||||
|
@ -0,0 +1,7 @@ |
||||
[Unit] |
||||
Description=Seafile DB cleaner service |
||||
|
||||
[Service] |
||||
Type=oneshot |
||||
PrivateTmp=yes |
||||
ExecStart={{ seafile_root_dir }}/bin/clean_db.sh |
@ -0,0 +1,9 @@ |
||||
[Unit] |
||||
Description=Seafile DB cleaner service |
||||
|
||||
[Timer] |
||||
OnCalendar=daily |
||||
Persistent=true |
||||
|
||||
[Install] |
||||
WantedBy=timers.target |
@ -0,0 +1,7 @@ |
||||
[Unit] |
||||
Description=Seafile Garbage Collect service |
||||
|
||||
[Service] |
||||
Type=oneshot |
||||
PrivateTmp=yes |
||||
ExecStart={{ seafile_root_dir }}/bin/gc.sh |
@ -0,0 +1,9 @@ |
||||
[Unit] |
||||
Description=Seafile Garbage Collect service |
||||
|
||||
[Timer] |
||||
OnCalendar=Sun *-*-* 02:10:00 |
||||
Persistent=true |
||||
|
||||
[Install] |
||||
WantedBy=timers.target |
Loading…
Reference in new issue