From 081fafc64e4109ed78c40fc3315495ef030e0343 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 4 Apr 2020 18:21:40 +0200 Subject: [PATCH] bundles/mx-puppet-discord: add systemd unit file --- bundles/mx-puppet-discord/files/service | 13 +++++++++++++ bundles/mx-puppet-discord/items.py | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 bundles/mx-puppet-discord/files/service diff --git a/bundles/mx-puppet-discord/files/service b/bundles/mx-puppet-discord/files/service new file mode 100644 index 0000000..81321c6 --- /dev/null +++ b/bundles/mx-puppet-discord/files/service @@ -0,0 +1,13 @@ +[Unit] +Description=mx-puppet-discord +After=network.target + +[Service] +User=mx-puppet-discord +Group=mx-puppet-discord +ExecStart=/usr/bin/node /opt/mx-puppet-discord/build/index.js -c config.yaml +WorkingDirectory=/opt/mx-puppet-discord/ +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/bundles/mx-puppet-discord/items.py b/bundles/mx-puppet-discord/items.py index 6337225..f6eb88d 100644 --- a/bundles/mx-puppet-discord/items.py +++ b/bundles/mx-puppet-discord/items.py @@ -17,6 +17,12 @@ files = { 'action:mx-puppet-discord_generate_registration', }, }, + '/etc/systemd/system/mx-puppet-discord.service': { + 'source': 'service', + 'triggers': { + 'action:systemd-reload', + }, + } } git_deploy = { @@ -67,3 +73,11 @@ actions = { 'triggered': True, }, } + +svc_systemd = { + 'mx-puppet-discord': { + 'needs': { + 'file:/etc/systemd/system/mx-puppet-discord.service', + }, + }, +}