This is a discussion on Script file to be run when linux boot within the Shell scripting forums, part of the Development/Scripting category; I would like to know how to run a script file while linux boot (Linux Susie) . there is a ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
I would like to know how to run a script file while linux boot (Linux Susie) . there is a file called serverStart.sh ,wht i have to do is run automattically while the Linux boot and when the linux shutdown it should run stopServer.sh . I hav tried with chkconfig but unable to do tht . So pLz help me to get out of it
|
| Sponsored Links | ||
|
|
|
|||
|
First, create a file called /etc/init.d/myserver with these contents (but fix the "/path/to" part):
Quote:
Most likely, you'll want to start it in each run level 2 through 5 (only), but it depends on your situation. Cheers. PS: The '12' and '02' values in the link filenames are numbers that determine the order in which applications are started or stopped on runlevel changes. The values I gave should have your server started after most other services, and stopped before most others. |
|
|||
|
Quote:
1. Sorry, I omitted that you need to make the script executable. Check/set it with: ls -l /etc/init.d/myserver2. If the ls -l showed it was not be executable (ref) then step #1 will likely fix it. 3. Before you bother rebooting, try it manually from the command line, and if it doesn't work as expected, report the results: /etc/init.d/myserver start4. If that works, then reboot and then check the log files under /var/log -- especially boot.msg and maybe messages. If you still have problems, show the output of ls -l for each script you have created or are calling, any output from log files and/or the console. G'Luck |
|
|||
|
Actually, this may be a better reference for the executable, and other, mode bits:
http://www.linuxfocus.org/English/Ja....html#section1 |
|
|||
|
ok i'll give u de brief deatails abt mi probs
1- there is a file called startServer.sh reside @ /opt/IBM/WebSphere/AppServer/bin and i have to run it manually in konsole as ./opt/IBM/WebSphere/AppServer/bin/startServer.sh 2 - what i want is that this script file should to be executed while system boots.. 3 - so wht is the easiest way to do the above |
|
|||
|
Okay, a 60 second Google search pointed me to this:
Restarting on SUSE LINUX platforms It's similar to what I posted, but provides more detaile info. And if it doesn't work you can probably call IBM support.... |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux boot partition | ramjimh | Linux software | 1 | 03-24-2008 07:48 PM |
| File System Error During Boot | svoltmer | Ubuntu / Debian | 3 | 02-21-2008 02:50 PM |
| problem with linux-2.6.12 kernel at boot time | khadar | Getting started tutorials | 0 | 09-12-2007 04:38 PM |
| dual boot windows 2003 server and linux | goku | Windows Xp/2000/2003 server administration | 2 | 07-17-2006 08:05 PM |
| Ubuntu Linux network installation using a boot server | tom | Getting started tutorials | 1 | 07-13-2006 06:56 PM |