Set up to allow cPanel users to run application in background (not root) - scratching my head on this one ..
I installed and setup docker and nginx as proxy as root so cPanel users could load and run dockers on their accounts.
The ngnix was installed using WHM console and docker was installed with yum installer. I had to manually added a vhost file and edit it for each users who want to run docker on their account with using their domain name. I created a vhost using a user cPanel sub-domain and a port not in use for docker.
The first test I did was to log in as a cPanel and open terminal then execute a docker with the port number that was assigned in vhost file to the sub-domain. It worked great so far.
My question is .. How do cPanel user (not root or su) execute an application like docker but leave it running in background even if they log out of cPanel.
I thought of using cron job to execute the script with docker commands but will cPanel cron job re-execute an script if the server reboots or restarted?
Is there another way for cPanel to set up scripts to be run all time in background that only need to be executed once like docker or re-execute if needed after a reboot?
Thank you,
Bill
-
Hey there! In general, this sounds more like you want a daemon than a script, as that isn't associated with a certain user, but does run as root. If you have a certain script in mind you could add the "&" symbol to the end of it to run in the background of bash, but I'm not sure if that's what you're looking for or not. Cron jobs are not re-executed after a reboot, until the next time they are triggered. cPanel doesn't officially support Docker yet (although we're getting there) so it's possible that some of this will work better once that is supported. 0 -
Hey there! In general, this sounds more like you want a daemon than a script, as that isn't associated with a certain user, but does run as root. If you have a certain script in mind you could add the "&" symbol to the end of it to run in the background of bash, but I'm not sure if that's what you're looking for or not. Cron jobs are not re-executed after a reboot, until the next time they are triggered. cPanel doesn't officially support Docker yet (although we're getting there) so it's possible that some of this will work better once that is supported.
Daemon is the word I was looking for .. The docker I am setting up is n8n -0 -
You'd have to have the command executed again after a reboot in order for that process to restart in the background. We'll make an announcement once we support Docker, but I know it's in the works and something a lot of users have asked for. 0 -
You'd have to have the command executed again after a reboot in order for that process to restart in the background. We'll make an announcement once we support Docker, but I know it's in the works and something a lot of users have asked for.
We're looking forward to it! For now, we will just tell the users to restart their dockers if for any reason server rebooted like a keneral upgrade etc.0
Please sign in to leave a comment.
Comments
4 comments