diff --git a/bundles/freescout/items.py b/bundles/freescout/items.py index e409e81..268c378 100644 --- a/bundles/freescout/items.py +++ b/bundles/freescout/items.py @@ -41,6 +41,10 @@ actions = { }, } +# svc_systemd = { +# f'freescout-cron.service': {}, +# } + # files = { # '/opt/freescout/.env': { # # https://github.com/freescout-helpdesk/freescout/blob/dist/.env.example diff --git a/bundles/freescout/metadata.py b/bundles/freescout/metadata.py index b15530e..ad0f84a 100644 --- a/bundles/freescout/metadata.py +++ b/bundles/freescout/metadata.py @@ -53,10 +53,31 @@ defaults = { }, }, }, + # 'systemd': { + # 'units': { + # f'freescout-cron.service': { + # 'Unit': { + # 'Description': 'Freescout Cron', + # 'After': 'network.target', + # }, + # 'Service': { + # 'User': 'www-data', + # 'Nice': 10, + # 'ExecStart': f"/usr/bin/php /opt/freescout/artisan schedule:run" + # }, + # 'Install': { + # 'WantedBy': { + # 'multi-user.target' + # } + # }, + # } + # }, + # }, 'systemd-timers': { 'freescout-cron': { 'command': '/usr/bin/php /opt/freescout/artisan schedule:run', - 'when': 'Minutely', + 'when': '*-*-* *:*:00', + 'RuntimeMaxSec': '600', 'user': 'www-data', }, }, @@ -70,6 +91,8 @@ defaults = { } + + @metadata_reactor.provides( 'freescout/env/APP_URL', ) diff --git a/bundles/systemd-timers/metadata.py b/bundles/systemd-timers/metadata.py index a7bd0ae..40b617a 100644 --- a/bundles/systemd-timers/metadata.py +++ b/bundles/systemd-timers/metadata.py @@ -42,6 +42,8 @@ def systemd(metadata): units[f'{name}.service']['Service']['SuccessExitStatus'] = config['success_exit_status'] if config.get('kill_mode'): units[f'{name}.service']['Service']['KillMode'] = config['kill_mode'] + if config.get('RuntimeMaxSec'): + units[f'{name}.service']['Service']['RuntimeMaxSec'] = config['RuntimeMaxSec'] services[f'{name}.timer'] = {} diff --git a/nodes/mseibert.freescout.py b/nodes/mseibert.freescout.py index 67fbd16..5d2f6c5 100644 --- a/nodes/mseibert.freescout.py +++ b/nodes/mseibert.freescout.py @@ -1,10 +1,10 @@ { - 'dummy': True, + #'dummy': True, 'hostname': '159.69.117.89', 'groups': [ -# 'backup', + 'backup', 'debian-12', -# 'monitored', + 'monitored', 'webserver', 'freescout', ],