Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hatappi
Last active December 1, 2016 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatappi/7511cb877912ed42c501ce849e9018b5 to your computer and use it in GitHub Desktop.
Save hatappi/7511cb877912ed42c501ce849e9018b5 to your computer and use it in GitHub Desktop.
Kuroko2 scheduler, processor, executor service
[Unit]
Description=Kuroko2 executor
[Service]
Environment=LANG=ja_JP.UTF-8
Environment=RAILS_ENV=production
Environment=NUM_WORKERS=2
Environment=QUEUE=@default
User=<user_name>
WorkingDirectory=<kuroko2プロジェクトのディレクトリ>
ExecStart=/usr/local/rbenv/shims/bundle exec rails runner 'Kuroko2::Servers::CommandExecutor.new.run'
ExecStop=/bin/kill -QUIT `/bin/cat <executerのpid fileのpath>`
KillMode=process
PIDFile=<executerのpid fileのpath>
[Install]
WantedBy=multi-user.target
[Unit]
Description=Kuroko2 processor
[Service]
Environment=LANG=ja_JP.UTF-8
Environment=RAILS_ENV=production
User=<user_name>
WorkingDirectory=<kuroko2プロジェクトのディレクトリ>
ExecStart=/usr/local/rbenv/shims/bundle exec rails runner 'Kuroko2::Servers::WorkflowProcessor.new.run'
ExecStop=/bin/kill -QUIT `/bin/cat <processorのpid fileのpath>`
KillMode=process
PIDFile=<processorのpid fileのpath>
[Install]
WantedBy=multi-user.target
[Unit]
Description=Kuroko2 scheduler
[Service]
Environment=LANG=ja_JP.UTF-8
Environment=RAILS_ENV=production
User=<user_name>
WorkingDirectory=<kuroko2プロジェクトのディレクトリ>
ExecStart=/usr/local/rbenv/shims/bundle exec rails runner 'Kuroko2::Servers::JobScheduler.new.run'
ExecStop=/bin/kill -QUIT `/bin/cat <schedulerのpid fileのpath>`
KillMode=process
PIDFile=<schedulerのpid fileのpath>
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment