LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-24-2010, 10:47 PM   #1
jtag
Member
 
Registered: Aug 2008
Posts: 33

Rep: Reputation: 0
scripts run at boot time with Debian single-user mode


I am starting Debian in single-user mode since my video is not detected in X mode.
I would like to start a script at boot time with Debian. I flowed the instruction from this page (http://www.debian-administration.org...me_with_Debian) but is not working.
Any suggestions ?
Thank you

Last edited by jtag; 04-24-2010 at 11:00 PM.
 
Old 04-25-2010, 12:31 AM   #2
kainosnous
Member
 
Registered: Mar 2010
Location: Tennessee, USA
Distribution: Arch, Fedora
Posts: 59

Rep: Reputation: 18
First, make sure that your script works from the command line:

Code:
/etc/init.d/yourscript.sh start
Once you are sure that works, try initiating it with the symbolic link under rc1.d To find which number it is, use ls /etc/rc1.d/S??yourscript Assuming that it is 20, start your script with:

Code:
/etc/rc1.d/S20yourscript start
If all else fails, you could just try putting it in rc.local:

Code:
echo "/etc/init.d/yourscript.sh" >> /etc/rc.local
 
Old 04-25-2010, 07:09 AM   #3
jtag
Member
 
Registered: Aug 2008
Posts: 33

Original Poster
Rep: Reputation: 0
I tested the script is working perfect.

my link script is:
/etc/rc0.d/K20yourscript start

About the third command, I added manual in the /etc/rc.local since there is an "exit 0". Then I did cat /etc/rc.local, then copy the line that was added and pasted in CLI for test; the script is working but when I start in single user mode the script is not executed!!!
(FYI, when I start in single user mode I have something like: "Give root password or type Control-D to continue"; this is to start X mode)




cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/etc/init.d/start.sh

exit 0




If I start in X mode and connect with ssh to PC (since my video is not detected), the start.sh script is already started (automatically).

Last edited by jtag; 04-25-2010 at 03:50 PM.
 
Old 04-28-2010, 02:33 AM   #4
kainosnous
Member
 
Registered: Mar 2010
Location: Tennessee, USA
Distribution: Arch, Fedora
Posts: 59

Rep: Reputation: 18
You said that the link to your script is "/etc/rc0.d/K20yourscript start", but that is the link for runlevel 0 (halt). You should make a link "/etc/rc1.d/S20yourscript" Notice that the rc0.d is for the halt runlevel and rc1.d is for single user. Also notice that the "K" at the start means kill your script (it is run as K20yourscript stop) and "S" at the start means to start your script (it is run as S20yourscript start). Try this:

Code:
ln -sv /path/to/yourscript /etc/rc1.d/S20yourscript
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is single-user mode in Debian? ingmember Linux - Newbie 2 10-27-2009 06:22 PM
boot to GUI problem want grub boot to single user mode. hocheetiong Linux - Newbie 1 09-26-2007 06:41 PM
How to boot in single-user mode in Slackware 9.1 rsamurti Slackware - Installation 8 05-13-2004 04:03 PM
`Shutdown now` goes to single user mode? Paused Start time guardian653 Linux - Security 1 12-11-2003 05:10 PM
single-user mode can't boot eye Red Hat 1 11-19-2003 04:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration