How to autostart service in ANY linux?
Posted
by
user329115
on Super User
See other posts from Super User
or by user329115
Published on 2014-06-03T21:24:57Z
Indexed on
2014/06/03
21:28 UTC
Read the original article
Hit count: 144
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?
© Super User or respective owner