Skip to content

Instantly share code, notes, and snippets.

@sanzstez
Created July 3, 2018 07:47
Show Gist options
  • Select an option

  • Save sanzstez/5bd330f85e2ad982e8d2155fe8dd4f61 to your computer and use it in GitHub Desktop.

Select an option

Save sanzstez/5bd330f85e2ad982e8d2155fe8dd4f61 to your computer and use it in GitHub Desktop.
cat ~/.config/default/action_cable
RVM_STRING = 2.4.3@schoolhire-app
PUMA_OPTS = "-e staging -p 28080 cable/config.ru"
DAEMON = puma
EXEC_COMMAND = cd /application/current && /.rvm/bin/rvm-shell ${RVM_STRING} -c "bundle exec ${DAEMON} ${PUMA_OPTS}"
~/.config/systemd/user/action_cable.service
[Unit]
Description = Action Cable
[Service]
ExecStart = /bin/bash -c ${EXEC_COMMAND}
ExecReload=/bin/kill -s USR2 $MAINPID
KillSignal = SIGQUIT
TimeoutStopSec = 62
KillMode = process
Restart = on-failure
RestartSec = 60
EnvironmentFile = /home/schoolhire/.config/default/action_cable
PIDFile=/home/schoolhire/application/shared/tmp/pids/action_cable.pid
[Install]
WantedBy = default.target
systemd enable action_cable
https://wiki.archlinux.org/index.php/Systemd/User
loginctl enable-linger username
щоб при завершені сесії юзера не завершувалися процеси systemd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment