Calling Brew Installed Application from Systemd Timer / Service
Hi,
So I've installed a service from brew that I'd like to set up to a systemd timer. I've configured the timer to call a specific shell script once every day and would like that service to run on the user level, so I've enabled the timer and started it via the
--user
flag. This is good enough to do most user-level tasks such as file creation or logging or any application installed via layering.
However, one utility I want to call via timer is installed through brew
and is located in a the user folder linuxbrew
. This means that the executable is not added to my path automatically and results in an error. Trying to use the full path to the executable (which can be found by doing which <servicename>
also doesn't work.
Any advice for this particular problem? Is there some kind of file I can source
to solve this problem and have all brew utilities available to my user-level systemd timer?1 Reply
you need to call
brew shellenv
to load brew path
or if brew are not in path then /home/linuxbrew/.linuxbrew/bin/brew shellenv