ysdragon / Pterodactyl-VPS-Egg

Pterodactyl VPS Egg
46 stars 28 forks source link

How can I run a service after reboot? #12

Closed joti-prime closed 4 months ago

joti-prime commented 5 months ago

For example, I am using Ubuntu and have installed Nginx. However, after rebooting, I need to manually enable it again using the Nginx command. Is there any way to configure it to start automatically? Any suggestions?

ysdragon commented 5 months ago

Try to add your command to start service to:

~/.bashrc
joti-prime commented 4 months ago

How? And where?

ysdragon commented 4 months ago
/home/container/.bashrc
joti-prime commented 4 months ago

I put this inside the .bashrc file: nginx -s reload || nginx and is not working

ysdragon commented 4 months ago

I will create a script to make it simple for everyone. Please use Void Linux for now, which autostarts nginx by default.

joti-prime commented 4 months ago

Will be interesting to have an script or env variable or something to autostart things (Nginx is an example, so must work with most of the things)

ysdragon commented 4 months ago

Yes, you can create an script and customize it as you want, i will create one soon!

joti-prime commented 4 months ago

Nice, please send me a comment when you have the script.