I am using rc.local to run a python script on boot up on a raspberry pi and it almost always runs without an issue but on occasion, it seems like it might be crashing. Can a script run in rc.local crash with no error in the code? Would it be better to use systemd instead?
rc.local doesn't do much besides run your code.
A benefit to
systemd is that it has an option to restart your code if it crashes, which
rc.local does not.
So if you can't prevent your code from crashing in the same way again, perhaps you can design so that it at least has a chance of working properly if it is restarted after such a crash.