db122 if/when the "start" scripts for a node.js application will be called by the system on my VPS instance if it ever reboots/resets.
NodeJS apps created via your Opalstack dashboard include a cron job that runs your app's start command at 10 minute intervals. If you want it to run immediately upon reboot, then run crontab -e
and add a line like the following to your cron jobs:
@reboot /home/shelluser/apps/appname/start > /dev/null 2>&1
db122 Is the naming of these scripts special -- or are they strictly for my use and I can move it into source control, etc.
The scripts aren't used by anyone except you (including the aforementioned cron jobs). Most of the time these scripts are generated by the installer and are hardcoded to use your Opalstack shell user home directory, app name, assigned port, etc. You're free to keep them in source control, rewrite them, or do whatever you want with them. 🙂
db122 Similarly, would "stop" ever be called? At shutdown? Will shutdown ever occur on a VPS?
We generally don't stop your apps unless we're troubleshooting stuff for you.
Generally the only time a server is shut down is for maintenance or an upgrade. In those cases we do that via the shutdown
command so the OS should gracefully shut down your processes for you.
If there's a problem on the server that prevents us from issuing a shutdown command, then in those cases its necessary to power-cycle the server. In those rare cases your app would not be gracefully shut down.