#systemd unit file service for unicorn 5.x / Centos 7.x [Unit] Description=unicorn - app xxx #After=nginx.service [Service] Type=forking PIDFile=/DOCROOT/shared/tmp/pids/unicorn.pid User=appuser Group=appgroupname WorkingDirectory=/DOCROOT/current #Below, the rack env is set-up to none for production. It could be rewrited by rails init (you should export RAILS_ENV to the system) ExecStart=/usr/local/rvm/wrappers/ruby-2.3.0/unicorn -c /DOCROOT/current/config/unicorn.rb -E none -D ExecStop=/usr/bin/kill -QUIT $MAINPID #USR2 signal will spawn the new master process, the kill signal to the old master should be send from rails ExecReload=/bin/kill -s SIGUSR2 $MAINPID CPUAccounting=true MemoryAccounting=true BlockIOAccounting=true PrivateTmp=true NoNewPrivileges=true [Install] WantedBy=multi-user.target