From 57b9fa1fe02e5cfe2a57f52f65ea99f928bea402 Mon Sep 17 00:00:00 2001 From: Kohei Suzuki Date: Wed, 9 Nov 2016 23:59:50 +0900 Subject: [PATCH] Add example systemd unit files --- docs/admin_guide.md | 2 ++ docs/systemd/kuroko2-executor.service | 15 +++++++++++++++ docs/systemd/kuroko2-processor.service | 13 +++++++++++++ docs/systemd/kuroko2-scheduler.service | 13 +++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 docs/systemd/kuroko2-executor.service create mode 100644 docs/systemd/kuroko2-processor.service create mode 100644 docs/systemd/kuroko2-scheduler.service diff --git a/docs/admin_guide.md b/docs/admin_guide.md index 621f2612..a40f7eaa 100644 --- a/docs/admin_guide.md +++ b/docs/admin_guide.md @@ -13,6 +13,8 @@ The Web UI (Web Console) is a rails application. All kuroko2 daemons backend is [serverengine gem](https://github.com/fluent/serverengine). +Example systemd unit files are available [here](systemd). + #### job-scheduler diff --git a/docs/systemd/kuroko2-executor.service b/docs/systemd/kuroko2-executor.service new file mode 100644 index 00000000..373ded01 --- /dev/null +++ b/docs/systemd/kuroko2-executor.service @@ -0,0 +1,15 @@ +[Unit] +Description=Kuroko2 executor + +[Service] +Environment=LANG=en_US.UTF-8 +Environment=RAILS_ENV=production +Environment=NUM_WORKERS=8 +Environment=QUEUE=@default +User=kuroko2 +WorkingDirectory=/home/kuroko2/kuroko2/current +ExecStart=/usr/bin/bundle exec rails runner 'Kuroko2::Servers::CommandExecutor.new(log: nil, daemonize: false).run' +KillMode=process + +[Install] +WantedBy=multi-user.target diff --git a/docs/systemd/kuroko2-processor.service b/docs/systemd/kuroko2-processor.service new file mode 100644 index 00000000..3ef4b703 --- /dev/null +++ b/docs/systemd/kuroko2-processor.service @@ -0,0 +1,13 @@ +[Unit] +Description=Kuroko2 processor + +[Service] +Environment=LANG=en_US.UTF-8 +Environment=RAILS_ENV=production +User=kuroko2 +WorkingDirectory=/home/kuroko2/kuroko2/current +ExecStart=/usr/bin/bundle exec rails runner 'Kuroko2::Servers::WorkflowProcessor.new(log: nil, daemonize: false).run' +KillMode=process + +[Install] +WantedBy=multi-user.target diff --git a/docs/systemd/kuroko2-scheduler.service b/docs/systemd/kuroko2-scheduler.service new file mode 100644 index 00000000..ffe5c8a5 --- /dev/null +++ b/docs/systemd/kuroko2-scheduler.service @@ -0,0 +1,13 @@ +[Unit] +Description=Kuroko2 scheduler + +[Service] +Environment=LANG=en_US.UTF-8 +Environment=RAILS_ENV=production +User=kuroko2 +WorkingDirectory=/home/kuroko2/kuroko2/current +ExecStart=/usr/bin/bundle exec rails runner 'Kuroko2::Servers::JobScheduler.new(log: nil, daemonize: false).run' +KillMode=process + +[Install] +WantedBy=multi-user.target