From 7c24141cdf18971b8d7624b08d950c014ffd0160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Sat, 16 Sep 2017 17:48:42 +0200 Subject: [PATCH] added systemd unti files --- contrib/systemd/zammad-rails.service | 24 ++++++++++++++++++++++++ contrib/systemd/zammad-scheduler.service | 22 ++++++++++++++++++++++ contrib/systemd/zammad-websocket.service | 24 ++++++++++++++++++++++++ contrib/systemd/zammad.service | 17 ++++++++--------- contrib/systemd/zammad.sh | 17 +++++++++++++++++ 5 files changed, 95 insertions(+), 9 deletions(-) create mode 100644 contrib/systemd/zammad-rails.service create mode 100644 contrib/systemd/zammad-scheduler.service create mode 100644 contrib/systemd/zammad-websocket.service create mode 100755 contrib/systemd/zammad.sh diff --git a/contrib/systemd/zammad-rails.service b/contrib/systemd/zammad-rails.service new file mode 100644 index 000000000..0deb54a2d --- /dev/null +++ b/contrib/systemd/zammad-rails.service @@ -0,0 +1,24 @@ +[Unit] +Description=Zammad railsserver +After=syslog.target +After=network.target +After=zammad.service +Requires=zammad.service + +[Service] +Type=simple +User=zammad +Group=zammad +Restart=always + +WorkingDirectory=/opt/zammad + +Environment=RAILS_ENV=production +Environment=BUNDLE_BINARY=bundle +Environment=ZAMMAD_BIND_IP=127.0.0.1 +Environment=ZAMMAD_RAILS_PORT=3000 + +ExecStart=/bin/bash -l -c "${BUNDLE_BINARY} exec script/rails server -b ${ZAMMAD_BIND_IP} -p ${ZAMMAD_RAILS_PORT}" + +[Install] +WantedBy=zammad.service diff --git a/contrib/systemd/zammad-scheduler.service b/contrib/systemd/zammad-scheduler.service new file mode 100644 index 000000000..ee1fe4b3a --- /dev/null +++ b/contrib/systemd/zammad-scheduler.service @@ -0,0 +1,22 @@ +[Unit] +Description=Zammad scheduler +After=syslog.target +After=network.target +After=zammad.service +Requires=zammad.service + +[Service] +Type=simple +User=zammad +Group=zammad +Restart=always + +WorkingDirectory=/opt/zammad + +Environment=RAILS_ENV=production +Environment=BUNDLE_BINARY=bundle + +ExecStart=/bin/bash -l -c "${BUNDLE_BINARY} exec script/scheduler.rb start -t" + +[Install] +WantedBy=zammad.service diff --git a/contrib/systemd/zammad-websocket.service b/contrib/systemd/zammad-websocket.service new file mode 100644 index 000000000..2e875f376 --- /dev/null +++ b/contrib/systemd/zammad-websocket.service @@ -0,0 +1,24 @@ +[Unit] +Description=Zammad websocket +After=syslog.target +After=network.target +After=zammad.service +Requires=zammad.service + +[Service] +Type=simple +User=zammad +Group=zammad +Restart=always + +WorkingDirectory=/opt/zammad + +Environment=RAILS_ENV=production +Environment=BUNDLE_BINARY=bundle +Environment=ZAMMAD_BIND_IP=127.0.0.1 +Environment=ZAMMAD_WEBSOCKET_PORT=6042 + +ExecStart=/bin/bash -l -c "${BUNDLE_BINARY} exec script/websocket-server.rb -b ${ZAMMAD_BIND_IP} -p ${ZAMMAD_WEBSOCKET_PORT} start" + +[Install] +WantedBy=zammad.service diff --git a/contrib/systemd/zammad.service b/contrib/systemd/zammad.service index 4bd2f53d3..15dfeef4b 100644 --- a/contrib/systemd/zammad.service +++ b/contrib/systemd/zammad.service @@ -2,18 +2,17 @@ Description=Zammad After=syslog.target After=network.target +StopWhenUnneeded=true +Wants=zammad-rails.service +Wants=zammad-scheduler.service +Wants=zammad-websocket.service [Service] Type=simple -User=