Jump to content

Recommended Posts

Posted
Username: bobrock, Server: Tommy, Main domain: bobrock.heliohost.us

After pulling from my GitHub account to bobrock.heliohost.us I want to execute a shell command before deploying to the server: /bin railsassets:precompile. Everything works fine until I try to deploy which fires the shell command. At that point I get the error:

user with id=11061 and name=bobrock not found in chrooted passwd file

Is there a way that I can fix that?

Bob
-------------------
Robert J. Rockefeller
Midway, GA

Posted

The commands for git deploy actions are jailed to your home folder, which can pose issues like this.

Someone else has successfully implemented Plesk's Git deploy actions using a CGI script to run commands during deployment. The method I described here and the responses from that user describing the final solution may be relevant: https://helionet.org/index/topic/63231-run-npm-script-in-git-deploy-actions/#findComment-285189 and should be adaptable to Rails instead of Node.

Note the requirement to create and run a scheduled task at least once first to set up the needed symlinks in your account.

 

 

Posted
That?s quite an approach!

When you say "jailed to your home folder,? does it preclude running a command if I have the executable at /home/bin/rails?

Bob
-------------------
Robert J. Rockefeller
Midway, GA

> On Feb 2, 2025, at 6:06?PM, HelioHost Support wrote:
>
> The commands for git deploy actions are jailed to your home folder, which can pose issues like this. Someone else has successfully implemented Plesk's Git deploy actions using a CGI script to run commands during deployment. The method I described here and the responses from that user describing the final solution may be relevant: https://helionet.org/index/topic/63231-run-npm-script-in-git-deploy-actions/#findComment-285189 and should be adaptable to Rails instead of Node. Note the requirement to create and run a scheduled task at least once first to set up the needed symlinks in your account.
>
> You may view the status of your ticket by visiting:
>
> https://helionet.org/index/index.php?showtopic=63483
>
> Thank you,
> HelioHost support
> https://heliohost.org/
> https://helionet.org/
>

Posted

The shell is restricted via chroot, so when you run commands in your account, the system views your home folder as if it were / . This makes it so you cannot see files and binaries outside your home folder. If you create a folder inside your home folder called bin and place a program called runme in it, you would call it using /bin/runme.

The passwd error is because of missing symlinks. Follow what I mentioned in that article about creating a scheduled task and running it. Once you do that, your home folder will have a bunch of folders like bin, usr, etc inside containing symlinks to essential system files and binaries. That should resolve the error you're seeing since running a scheduled task will create the missing passwd file mentioned in the error along with the symlinks.

Posted

Most binaries need to be able to access system libraries to run. I've never tested the rails binary personally, but it likely wouldn't work. You would probably have to statically compile it with all of the needed libraries inside the binary since it wouldn't be able to access /var/lib etc from inside the chroot.

Posted

I see. The Rails Way is to run a redeployment script on the server. In this case, I'll have to run that script locally and then commit, push, and pull the result. That can still work.

Posted

From the Ruby control panel I can run Rake tasks, one of which is `assets:precompile`! If only I could run that after I Git pull and before I Deploy! Is there a way?

Posted

Yes, like Wolstech already said, you should be able to do that with CGI. You can even use Ruby CGI if you prefer that language, but any scripting language should work.

  • Krydos locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...