LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   need to write a run level 3 script (https://www.linuxquestions.org/questions/linux-newbie-8/need-to-write-a-run-level-3-script-682685/)

knockout_artist 11-11-2008 03:03 PM

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.

unSpawn 11-11-2008 03:52 PM

Quote:

Originally Posted by knockout_artist (Post 3338671)
I need a script.

So either properly ask for it or provide code we could correct.

TB0ne 11-11-2008 04:05 PM

Quote:

Originally Posted by knockout_artist (Post 3338671)
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.

knockout_artist 11-12-2008 08:17 AM

Quote:

Originally Posted by unSpawn (Post 3338723)
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!!

knockout_artist 11-12-2008 08:34 AM

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

Tinkster 11-12-2008 11:45 AM

Quote:

Originally Posted by knockout_artist (Post 3339480)
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


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