Open aashishvasu opened 2 years ago
Hi aashishvasu, I hope you are doing well.
The error message you received, "/usr/bin/env: 'bash': No such file or directory," suggests that the shell specified in your systemd service file is not found. In your case, the shell specified is bash. However, the error indicates that the system cannot locate the bash executable.
To resolve this issue, you can try the following steps:
Check the availability of the bash executable on your system. Run the following command to verify its location:
which bash
Update the ExecStart line in your systemd service file to explicitly specify the shell executable with its absolute path. For example, if the bash executable is located at /bin/bash, modify the ExecStart line as follows:
ExecStart=/bin/bash -lc "/home/journal/.rbenv/bin/rbenv exec bundle exec rails s"
The -lc option ensures that the shell is invoked as a login shell and loads the necessary environment variables.
Save the changes to the systemd service file.
Reload systemd to pick up the changes by running the following command:
sudo systemctl daemon-reload
Restart the journal.service systemd unit to apply the changes:
sudo systemctl restart journal.service
Now, systemd should be able to locate the bash executable and execute the command specified in the ExecStart line successfully. Monitor the service logs using journalctl -u journal.service to check for any additional errors or issues that may arise.
Cheers, theClawsmos
I've followed the steps outlined in vps.md to set up Journal, and I have managed to get it running on manual starts quite easily.
However, I'm running into issues when creating a systemd service using the guide, and the service always fails. running
journalctl -u journal.service
gives me the error:After logging into the journal user, running the command
manually works correctly, it's only when the service starts is when the problem occurs. What do you think could be going wrong?
My
journal.service
file for context: