Correct way to startup user applications after restart?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Correct way to startup user applications after restart?
Hello everybody. I'm stuck at specific problem and I can't find solution anywhere. Please help me.
I installed Debian on some old Pentium II and some users (without root access) have access to the server. Some installed BNC, other eggdrop and other custom daemons. There is no X11 on server.
The problem is that when I restart the computer (or it restarts it self after power failure), then all daemons which users run will not rerun. Everyone has to login and rerun them manually. This happens very rare, about every 100 days, but it happens.
They could install own initscripts in /etc, but that would require a root access to the system. I, ofcourse, don't want to give everybody root access.
Question: How users may able to make their daemons rerun on startup without giving root access to the server?
There are a few ways you could do it, but the one that makes the most sense to me would be running them from per-user cron. You could write a script that runs every few minutes to check if the various daemons are up, and starts them if they aren't.
Actually starting them at boot time is going to require integrating with the boot scripts, which would take root-level access to do directly. Alternately you could have a function in your boot scripts that loaded scripts from each /home directory, but that would be exceptionally insecure as a user could put anything they wanted in there and have it run as root.
Ok, i checked three implementations of cron:
* Vixie cron: it sure would help, but it seems that you need to run "crontab ~/.crontab" from user;
* anacron: only the system administrator can configure anacron tasks;
* fcron: this is too advanced.
And /etc/init.d/cron does'nt load /home/*/.crontab files at startup.
Seems like I need to do some scripting. I think I can, I have same basic skills, but I'm sure that it will be 100% exploitable and also I want to make sure that I'm not reinventing a wheel.
You can do that, but again, this means any user could run any command as root.
So they could put a line in there that copied a shell with root permissions into their /home directory, and get a root shell without needing to crack the password. Or they could simply put in a "rm -rf" line to delete everything on the server.
If you are going to go this route, you really need to set it up so that any .startup scripts are run as a different user with minimal permissions, definitely not root.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.