Skip to content

Instantly share code, notes, and snippets.

@tizee
Created May 19, 2020 08:28
Show Gist options
  • Save tizee/eaadc770e30a1b750936b8ff15769cad to your computer and use it in GitHub Desktop.
Save tizee/eaadc770e30a1b750936b8ff15769cad to your computer and use it in GitHub Desktop.
Running DevDocs on local/remote server as a service
[Unit]
Description=devdocs in raspberry pi
[Service]
Type=simple
SyslogIdentifier=devdocs-pi
User=root
WorkingDirectory=/home/pi/devdocs/
PIDFile=/home/pi/devdocs.pid
Environment=BUNDLE_GEMFILE=/home/pi/devdocs/Gemfile
ExecStartPre=/usr/local/rvm/scripts/rvm
ExecStart=/usr/local/rvm/gems/ruby-2.6.5/wrappers/ruby /usr/local/rvm/gems/ruby-2.6.5/bin/bundle exec /usr/local/rvm/gems/ruby-2.6.5/bin/rackup /home/pi/devdocs/config.ru --host your_ip --port 9292
ExecReload=/usr/local/rvm/gems/ruby-2.6.5/wrappers/ruby /usr/local/rvm/gems/ruby-2.6.5/bin/bundle exec /usr/local/rvm/gems/ruby-2.6.5/bin/rackup /home/pi/devdocs/config.ru --host your_ip --port 9292
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment