Yes, but I imagine that does not allow for automatic restarts in case of a crash or JVM error and for folks like me that run bots for other streamers on a server with SSL certificates, I have jobs setup to auto-renew SSL and restart the bot via service. There are some advantages to using a service rather than something in rc.local that also doesn’t ensure that the machine is fully up and verifies that the network connection is up like services can do.
When it is Not Ok to use the /etc/rc.local file
The following are examples of rc.local misuse that I have seen with my own eyes. Usually this is caused by either a lack of understanding or just the lazy nature of a Sysadmin.
Starting an Application/Service
I’ve seen this many times, in fact when I was googling around for examples of rc.local I found an example where someone put the instructions needed to start apache into the /etc/rc.local file.
**Why this is bad: **The rc.local file may start up your service just fine, but when the system is shutting down the init process will not stop your application gracefully. If your application uses lock files this may mean your application doesn’t start on the next boot. In cases of applications it is always best to create an init script (or alternative depending on your distro i.e. Upstart or Systemd).
It would be bad if PhantomBot was not shutdown gracefully and the DB experienced a data corruption event.
Again, reasons we recommend services.