LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2008, 03:03 PM   #1
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Rep: Reputation: 33
need to write a run level 3 script


Good Day,


I need a script.

Nothing fancy.

1-need to run at runlevel 3.
2-su to-nonroot-usr
3-cd /to/dir
4. sh ./my.sh

Then exit. exit means let system resume the control.

Thanks.
 
Old 11-11-2008, 03:52 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Quote:
Originally Posted by knockout_artist View Post
I need a script.
So either properly ask for it or provide code we could correct.
 
Old 11-11-2008, 04:05 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,808

Rep: Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179Reputation: 4179
Quote:
Originally Posted by knockout_artist View Post
Good Day,

I need a script.
Nothing fancy.
You should write one then. Shouldn't take you long, since it doesn't need to be anything fancy.

If you need help debugging it after you've written it, feel free to post it.
 
Old 11-12-2008, 08:17 AM   #4
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by unSpawn View Post
So either properly ask for it or provide code we could correct.
ask properly ??

its 3 line code how do I provide more details ?
I make it easy, don't answer if you don't feel like!!
 
Old 11-12-2008, 08:34 AM   #5
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
ok I guess question I have is

Code:
 
su Auser         ----------->    since process id one wold be running whole start-up would  it retain user "Auser" 
                 ----------- or user would become root before it execute "cd"

cd /A/folder
./A.sh             
           --------------> OR do it stay Auser till this point
Other question is , just leaving script in /etc/rc.d/rc3.d would do the job?
or Do I need to make 2 scripts k and s ?

Thanks
 
Old 11-12-2008, 11:45 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by knockout_artist View Post
Other question is , just leaving script in /etc/rc.d/rc3.d would do the job?
or Do I need to make 2 scripts k and s ?

Thanks
The "normal" way of doing this is to have the script
in init.d and just have the K and S symlinks in rc3.d ...
And no - a script w/o [KS][[:digit:]] won't be executed
by the initscript system ... have a look, I'm sure there's
a README in one those that explains how things work ;D


Cheers,
Tink
 
  


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
set your default run level so you will boot to a default run level - vga console Adam555 Linux - Newbie 1 01-21-2008 04:55 PM
Write a script to run several commands ??? wahaha Linux - Software 1 04-13-2007 08:20 PM
emacs in run level 3 then switch to X (level 7) then back to level 3 dsoliver Slackware 3 09-01-2006 03:31 AM
/etc/X11/xinit/.Xmodmap; run level 4 won't init script Potatopopper Slackware 5 11-27-2005 07:37 PM
How to write startup script to run NTFS neosirex Linux - Newbie 4 05-31-2005 07:25 PM


All times are GMT -5. The time now is 09:12 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration