Executing script at system start up


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Executing script at system start up
# 1  
Old 01-12-2010
Executing script at system start up

Hi

I had written a piece of script .

Please let me know is it possible to run / execute this script at system startup ??

Thanks in advance .
# 2  
Old 01-12-2010
Quite possible. It depends on your distro, but most of them have /etc/local.start, /etc/conf.d/local.start, or some equivalent. Adding a line for your script file to it will cause it to run when the system finishes booting to its login prompts.

It's also possible to specify a script to run on start via a user's crontab:

Code:
@startup /path/to/my/script.sh

# 3  
Old 01-12-2010
Thank you very much .
# 4  
Old 01-13-2010
Hi ,

I am uisng Enterprise Linux 5 , i could not find anything as what you mentioned .Smilie

Can anybody please help me in this case .
# 5  
Old 01-13-2010
I usually create a script in /etc/rc3.d called S99local for this type of thing. That way when the system hits runlevel 3, it runs my script after everything else has started. Just make sure the permissions are set up correctly and owned by the superuser account.

Good luck!
# 6  
Old 01-13-2010
What version of Linux/Unix are you using? Typically every version of *nix has some sort of launch daemon that controls and launches everything at start up. For example, the Debian/Ubuntu flavors of Linux use /etc/init.d which can be used to launch your script at start up regardless if any user is logged in or not system wide.

If you want it to trigger when a particular user logs in you will have to set some kind of log in hook, and that can also be done by a launch daemon or it can be done by editing the user's default shell to launch the script when ran by editing their profile.

can you give some more details on what you are trying to accomplish here?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Iso - remaster script trying to start chroot run commands then exit but host system gets messed up

The script works and creates a modified iso fine until I added the chrootbeg and chrootend functions and executed them. I'm sorry if I did something wrong this is my first post. I uploaded entire bash script for reference or in case you want to run it to debug it is called isoremast.txt. ... (5 Replies)
Discussion started by: paulhoffusa
5 Replies

2. Shell Programming and Scripting

Start Script on system reboot

Hi, I have the following script that looks for a certain file and then executes the start.sh file. How can i make this process to kick when the box reboots. Please advice if ; then /u01/Essbase/Oracle//Middleware/user_projects/epmsystem7/bin/start.sh; rm... (8 Replies)
Discussion started by: thinkingeye
8 Replies

3. What is on Your Mind?

How to start in System Administration?

Hi all, I wonder if you guys could give me some advice on this. I have messed around with Linux for the last few years, and I'm at the point where I would like to become a system administrator - as a career. I already have a bachelor's degree, but it is in the humanities (art history) so... (2 Replies)
Discussion started by: ScottLew
2 Replies

4. Shell Programming and Scripting

executing with system time

hi, i have written an shell script which reads an folder and write the filenames to another file: here is the script: #!/bin/bash find /var/www/vhosts/remixland.de/web_users/stream001/jingle15 -type f -name "*.mp3" > /etc/shoutcast001/example.lst killall -USR1 sc_trans_linux001... (1 Reply)
Discussion started by: maydo
1 Replies

5. Shell Programming and Scripting

Executing AWK in a perl script using 'system'...

I have a simple perl script that looks similar to this: #!/usr/bin/perl/ # Have a lot of PERL code in the front of this script. #Would now like to execute a system command using AWK system (qq(cd /location && awk '/full/ {print $1;exit}' /myfile)); The system command in my perl script... (4 Replies)
Discussion started by: SysAdm2
4 Replies

6. Shell Programming and Scripting

How to monitor system activity while executing tests

I need to monitor system activity (RAM, CPU usage, execution time) while running some tests on solaris, linux and aix and save the output. Please advise whether there's a utility available for these systems? How can time the execution of the command? Thanks! (2 Replies)
Discussion started by: smovla
2 Replies

7. AIX

Q: how to start a service when system start

As topic, assume we have a service called "blahservice" and we can start it by: startsrc -s blahservice what is the best practice to run such command when system start? - directly use mkitab to add it into /etc/inittab or - drop startup scripts in /etc/rc.d/rcX.d I know they... (4 Replies)
Discussion started by: acerlinux
4 Replies

8. Shell Programming and Scripting

Executing a script on a remote system via SSH

Hello all, I have a relatively simple script I wrote to generate a count of errors broken down. What I would like to do is execute this script from another server so that I don't actually have to log in to the server to run the check. The script on what we'll call "Server A" is: ... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

9. SuSE

Executing set of sh files at system startup

Hi Everybody I am totally new to Linux. We are using Suse Linux version 9. Currently we have 4 to 5 shell scripts which needs to be executed manually by the users.I want these scripts to be run automatically when system starts...something like system startup service. When system is... (1 Reply)
Discussion started by: appleforme1415
1 Replies

10. SCO

System will not start

I am running OpenServer 5.0.5a on a Compaq Proliant 800. When trying to start the system it goes through loading everything and at the end I get the following message. WARNING: hd: no root disk controller was found H iinit ime Loadable Driver May be requiredG drain8042 PANIC: srmontfun -... (1 Reply)
Discussion started by: karlb1
1 Replies
Login or Register to Ask a Question