How to autostart service in ANY linux?
- by user329115
I need to install the dumbest possible service (a binary) and have it reliably run as the current user at boot (or login, whatever) at as many platforms as possible (of the aging point-of-sale type). The app monitors another archives generated by another app in the user-session.
Startup alternatives considered:
init.d
@reboot in crontab
a .desktop file in ~/.config/autostart
a myriad of other solutions including .profile and .bashrc
All of the above break down at some point. The problems stem from not wanting to run as root (I want the files generated to be user-accessible), and not having a way to reliably get the current user name in sudo on all platforms. Ideally not even sudo can be assumed available.
Hey, I just want to run something on boot and I have "root" power to do so. Windows get the job done easily enough. This isn't rocket science, is it?