Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| chruby [2023/02/10 21:59] – slack | chruby [2023/02/11 10:28] (current) – slack |
|---|
| For ''systemd'' services, this should be sufficient: | For ''systemd'' services, this should be sufficient: |
| |
| Environment="PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" | [Service] |
| Environment="SHELL=/bin/zsh" | User=slack |
| ExecStart=/opt/rubies/ruby-3.0.3/bin/ruby /home/slack/porridge/weather/bin/weatherd | Group=slack |
| | WorkingDirectory=/home/slack/porridge/daemon |
| | # sbin shouldn't be needed if you are running as a normal user |
| | # Environment="PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" |
| | Environment="PATH=/bin:/usr/bin:/usr/local/bin" |
| | # I have had "chruby-exec[157986]: zsh:1: command not found: chruby" when using zsh |
| | Environment="SHELL=/bin/bash" |
| | ExecStart=chruby-exec 3.0.3 -- /home/slack/porridge/weather/bin/weatherd |
| | # This worked for some services but threw gem errors for others |
| | # ExecStart=/opt/rubies/ruby-3.0.3/bin/ruby /home/slack/porridge/weather/bin/weatherd |
| | |
| |
| See [[https://github.com/postmodern/chruby/wiki/Cron|instructions for cron]], [[https://www.baeldung.com/linux/systemd-services-environment-variables|congifuring systemd environment]] and [[https://stackoverflow.com/questions/35439123/systemd-environment-directive-to-set-path|setting PATH for systemd]]. | See **[[https://github.com/postmodern/chruby/wiki/Cron|instructions for cron]]**, [[https://www.baeldung.com/linux/systemd-services-environment-variables|congifuring systemd environment]] and [[https://stackoverflow.com/questions/35439123/systemd-environment-directive-to-set-path|setting PATH for systemd]]. |