my bash script :
#!/bin/bash . ~/er/erl/activate kiex use 1.13.4 mix phx.server i user kerl and kiex to manage my erlang and elixir installations
I am trying to use this script in my service;
[Unit] Description=BlockScout Server After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=always RestartSec=1 User=ubuntu StandardOutput=syslog StandardError=syslog WorkingDirectory=/usr/local/blockscout ExecStart=/usr/local/bin/startBlockscout.sh EnvironmentFile=/usr/local/blockscout/env_vars.env [Install] WantedBy=multi-user.target as you can see, startBlockscout.sh is the name of my bash script. i intend to run this script as a part of the Execstart field in a linux service
i want to know, how can i make sure that my script recognises the kerl and kiez while running in a service
i keep getting the errors;
line 3: kiex: command not found line 4: mix: command not found if i try to use the same commands in a bash script that i launch directly from the shell, the commands of kiex and mix work !
they just don't work when i am trying to execute them using the service
any advice is greatly appreciated !
~in the script referring to when running as a service)?PATHvariable of the ubuntu-user does load the commands only via e.g. bashrc, which would not happen for the service.