[systemctl]unicorn

LINEで送る
Pocket

  •  /usr/lib/systemd/system/unicorn.service
[Unit]
Description=Unicorn Server
After=mysqld.service

[Service]
User=adachin
WorkingDirectory=/var/www/app
Environment=RAILS_ENV=production
SyslogIdentifier=unicorn
PIDFile=/var/www/app/tmp/pids/unicorn.pid

ExecStart=/home/adachin/.rbenv/shims/bundle exec unicorn_rails -c /var/www/app/config/unicorn.conf.rb
ExecStop=/usr/bin/kill -QUIT $MAINPID
ExecReload=/bin/kill -USR2 $MAINPID

[Install]
WantedBy=multi-user.target
  • systemctl
# chmod +x /etc/systemd/system/unicorn.service
# systemctl daemon-reload
# systemctl enable unicorn
# systemctl start unicorn
# systemctl stop unicorn
# systemctl restart unicorn

Was this helpful?

0 / 0

コメントを残す 0

Your email address will not be published. Required fields are marked *