Re: Script execution at boot time..
On Fri, 14 May 2004 20:52:19 -0400 (EDT) Ishwar Rattan <[EMAIL PROTECTED]> wrote: > I understand that there is documentation. I have looked at it > but have not had success. If you can help, please do so. > > -ishwar > Here are the startup script basics: There are different run levels for running a Unix system. Run level 2 is the default for Debian. $ grep default /etc/inittab # The default runlevel. id:2:initdefault: So when Debian goes to run startup scripts it looks in the /etc/rc2.d directory. If you list that directory you will find symbolic links to scripts in the /etc/init.d directory. The purpose is to have one place to store startup scripts and allow links from the various runlevel directories instead of copying and having to maintain multiple scripts in multiple directories. If you want a script to run during the boot process, put the script in the /etc/init.d directory (make sure it is executable) and make a symbolic link to it from the /etc/rc2.d directory. The symbolic link should be named with the following pattern: SXXname. Where S is for start, XX is a two digit number to determine what order to start and name is the name of the script found in /etc/init.d. In /etc/rc0.d and /etc/rc6.d you will find corresponding stop scripts (KXXname with the K for kill). The update-rc.d program can help with creation of the rc links, but it can also be done manually. If you install a Debian package that requires a startup script, it should be taken care of automatically by the package. The ssh package does this. Hopefully, this information helps to better understand the documentation. I am also willing to help clarify information in the documenation if you have specific questions after reviewing it. -- Carlos Hanson Webmaster and Postmaster Tigard-Tualatin School District ph: 503.431.4053 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Script execution at boot time..
On Fri, May 14, 2004 at 04:26:48PM -0400, Ishwar Rattan wrote: > I have written a shell script /etc/init.d/rclocal > with two lines.. > > /etc/init.d/ssh start > /home/mine/iptablerules > > and created a link in /etc/rc3.d > > S99rclocal link to ../init.d/rclocal > > and reboot won't execute the script. If I do the same by hand it > works. I aso tried placing the link in /etc/rc2.d bu had no luck. Perhaps you forgot to make the script executable? Much simpler just to add a link in rc2.d for ssh, though; you could even use 'dpkg-reconfigure ssh'. -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Script execution at boot time..
Ishwar Rattan wrote: I understand that there is documentation. I have looked at it but have not had success. If you can help, please do so. # vi /etc/init.d/rclocal #!/bin/sh /etc/init.d/ssh start /home/mine/iptablerules Make it executable: # chmod ug+x /etc/init.d/rclocal Symlink the script to run on multi-user boot # ln -s /etc/init.d/rclocal /etc/rc2.d/S99rclocal By default, your system boots into runlevel 2. Runlevels 3, 4, and 5 are not used on your Debian system unless you choose to configure and use them. But I should ask: why did you choose this rclocal method rather than simply placing a symlink to /etc/init.d/ssh in the desired runlevel? In fact, at package installation time, ssh should have created such links for you. Going the route you are, will you be doing anything to ensure that your ssh daemon is properly stopped at reboot (runlevel 6) and halt (runlevel 0)? dircha -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Script execution at boot time..
I understand that there is documentation. I have looked at it but have not had success. If you can help, please do so. -ishwar On Fri, 14 May 2004, Carlos Hanson wrote: > Rather than repeating existing documentation, I must again provide a > link to the documention: > > http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit > > > On Fri, 14 May 2004 16:26:48 -0400 (EDT) > Ishwar Rattan <[EMAIL PROTECTED]> wrote: > > > > > I have written a shell script /etc/init.d/rclocal > > with two lines.. > > > > /etc/init.d/ssh start > > /home/mine/iptablerules > > > > and created a link in /etc/rc3.d > > > > S99rclocal link to ../init.d/rclocal > > > > and reboot won't execute the script. If I do the same by hand it > > works. I aso tried placing the link in /etc/rc2.d bu had no luck. > > > > Any help will be appreciated. > > > > -ishwar > > > > > -- > Carlos Hanson > Webmaster and Postmaster > Tigard-Tualatin School District > > ph: 503.431.4053 > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] > -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Script execution at boot time..
Rather than repeating existing documentation, I must again provide a link to the documention: http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit On Fri, 14 May 2004 16:26:48 -0400 (EDT) Ishwar Rattan <[EMAIL PROTECTED]> wrote: > > I have written a shell script /etc/init.d/rclocal > with two lines.. > > /etc/init.d/ssh start > /home/mine/iptablerules > > and created a link in /etc/rc3.d > > S99rclocal link to ../init.d/rclocal > > and reboot won't execute the script. If I do the same by hand it > works. I aso tried placing the link in /etc/rc2.d bu had no luck. > > Any help will be appreciated. > > -ishwar > -- Carlos Hanson Webmaster and Postmaster Tigard-Tualatin School District ph: 503.431.4053 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Script execution at boot time..
I have written a shell script /etc/init.d/rclocal with two lines.. /etc/init.d/ssh start /home/mine/iptablerules and created a link in /etc/rc3.d S99rclocal link to ../init.d/rclocal and reboot won't execute the script. If I do the same by hand it works. I aso tried placing the link in /etc/rc2.d bu had no luck. Any help will be appreciated. -ishwar On Fri, 14 May 2004, Ishwar Rattan wrote: > > How does one start local services? I run ssh daemon after boot using > > #/etc/init.d/ssh start > > is there way to execute a /etc/rc.local file as the last step in boot > process? > > Any ideas? > > -ishwar > > -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]