-   Linux - Server (
-   -   Configuring start-up applications (

zeroquaranta 03-08-2010 06:01 AM

Configuring start-up applications
Hi all,
I would like to configure my server to automatically launch a script at boot up time (i.e. without the need to log in), but I got lost in services, session-managed and non-session-managed applications. Still, I'm confused about whether crontabs for each user become automatically active at boot up.
Could anybody help?

catkin 03-08-2010 07:20 AM

Boot script organisation is distro-specific. Which distro are you using?

As long as crond is started at boot, it processes all the crontabs (unless it is started with a -d option with the wring directory). Use ps -ef | grep cron to see if it is running.

AlucardZero 03-08-2010 07:31 AM

Generally you can accomplish this by calling your script from /etc/rc.local or putting a "@reboot command" entry in a user's crontab, but again it is distro-specific.

zeroquaranta 03-09-2010 03:50 AM

Ok. I'm using RHEL 5.4. Basically, my aim is to get my server "power cut proof", without the need to manually launch scripts (even though I know power cuts can always cause unpredictable things).
So, my understanding is that I probably have nothing to do for crontab.
As for automatically launch scripts, I will check the 'rc.local' thing to see if it works.
Just for curiosity, what about the "session-managed startup applications" ? It's applications associated to a specific user which gets automatically started when the user logs in (i.e. starts a session)?

Blue_Ice 03-09-2010 02:39 PM

Create a daemon script.
Use 'chkconfig --add <script_name>' to add the script.
Use 'chkconfig <script_name> on' to activate the script during the boot sequence (init levels and starting/closing order have to be defined in your script).
If you want to start the script immediately, then you can use service <script_name> start

Be aware that the daemon script has a header that has to be implemented correctly to make this to work. The script has to be in directory /etc/rc.d/init.d.

All times are GMT -5. The time now is 03:26 PM.