Boot script
Boot script
I want to run script before login.
I stored my script file in /etc/rc3.d.
still its not work.
Whenever i reboot it just hang up at theme page and it does not allowd me to log in.
I am using centos 6.
My script is for just showing me ip address and option with dhcp setting.
It work fine without any error.
It work in centos 5.6.
I stored my script file in /etc/rc3.d.
still its not work.
Whenever i reboot it just hang up at theme page and it does not allowd me to log in.
I am using centos 6.
My script is for just showing me ip address and option with dhcp setting.
It work fine without any error.
It work in centos 5.6.
Re: Boot script
Hi,
please put a [code]ls -l [sriptname][/code]
here and put the content of the script itself here.
THX
neo67
please put a [code]ls -l [sriptname][/code]
here and put the content of the script itself here.
THX
neo67
Re: Boot script
[quote]
-rwxr-xr-x 1 root root 5060 Jul 28 01:40[/quote]
-rwxr-xr-x 1 root root 5060 Jul 28 01:40[/quote]
Re: Boot script
yeah dear it should works with CentOS 5.x because the boot process starts all processes in rcx.d
but it different with CentOS 6.x, because it doesn't use regular boot process, it uses something called Upstart
so it starts jobs which is specified in each run levels in /init.d/ directory.
for more information see this link
[url=http://upstart.ubuntu.com/]http://upstart.ubuntu.com/[/url]
but it different with CentOS 6.x, because it doesn't use regular boot process, it uses something called Upstart
so it starts jobs which is specified in each run levels in /init.d/ directory.
for more information see this link
[url=http://upstart.ubuntu.com/]http://upstart.ubuntu.com/[/url]
Boot script
Simple Solution:
If the timing works, I would try calling the script from /etc/rc.local. It will execute after all other init scripts. I'm not sure if it is before you have the ability to login or not though. Add a line to the end of the file calling your script.
More Complicated Solution:
If you need to start it via run levels, I would suggest putting your script into /etc/rc.d/init.d. That is the location of other startup scripts. The rcX.d directories are symbolic links to the scripts in init.d. The links in rcX.d directories all start with S or K and have some number. The number indicates the order that the script will run in the startup/shutdown process. S is start and K is kill. If you look at the contents of the scripts in the init.d directory, you will see a section in the script such as
# Linux chkconfig stuff:
#
# chkconfig: 2345 25 10
# description: Startup/shutdown script for the Common UNIX \
# Printing System (CUPS).
It is part of the commented section, but that defines the S number and K number as well as the run levels that the service will start. This will allow you to add your script as part of the chkconfig command. That will create and manage the S or K links for you in each of the rcX.d directories with the appropriate startup/shutdown order. It will also make the script easier to port to other systems and manage on an ongoing basis.
If the timing works, I would try calling the script from /etc/rc.local. It will execute after all other init scripts. I'm not sure if it is before you have the ability to login or not though. Add a line to the end of the file calling your script.
More Complicated Solution:
If you need to start it via run levels, I would suggest putting your script into /etc/rc.d/init.d. That is the location of other startup scripts. The rcX.d directories are symbolic links to the scripts in init.d. The links in rcX.d directories all start with S or K and have some number. The number indicates the order that the script will run in the startup/shutdown process. S is start and K is kill. If you look at the contents of the scripts in the init.d directory, you will see a section in the script such as
# Linux chkconfig stuff:
#
# chkconfig: 2345 25 10
# description: Startup/shutdown script for the Common UNIX \
# Printing System (CUPS).
It is part of the commented section, but that defines the S number and K number as well as the run levels that the service will start. This will allow you to add your script as part of the chkconfig command. That will create and manage the S or K links for you in each of the rcX.d directories with the appropriate startup/shutdown order. It will also make the script easier to port to other systems and manage on an ongoing basis.
Re: Boot script
My previous post does describe the "old" method, but Upstart is configured to run the sysv runlevel scripts. Converting the script to a pure Upstart script may be your best choice
Re: Boot script
Hi!
I have seen this problem sometimes when I forget to add the & at the end of the line, so the script is run but it never ends so the system gets stuck. Maybe that's what's happening here
Regards.
I have seen this problem sometimes when I forget to add the & at the end of the line, so the script is run but it never ends so the system gets stuck. Maybe that's what's happening here
Regards.
Re: Boot script
Thanks for your help.
But where should i add '&'.
In my script or where i am calling the file.
I tried both but it skip the execution of my script file and directly goes to login page.
It is because of plymouth theme.
I am changing the default theme to my customize theme.
In my script i am using dialog box.
But where should i add '&'.
In my script or where i am calling the file.
I tried both but it skip the execution of my script file and directly goes to login page.
It is because of plymouth theme.
I am changing the default theme to my customize theme.
In my script i am using dialog box.
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: Boot script
Startup scripts don't do interactive I/O.
You would be better off outputting to a file.
Do not double or tripple post.
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=32464&forum=55
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=32461&forum=55
You would be better off outputting to a file.
Do not double or tripple post.
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=32464&forum=55
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=32461&forum=55