Operating System - Tru64 Unix
1822580 Members
3383 Online
109642 Solutions
New Discussion юеВ

auto startup a script when bootup

 
adam yeong
Occasional Advisor

auto startup a script when bootup

Hi all,
I need some help, how to auto startup a script whne bootup. I try to auto enable text editor when bootup. I had write a script with "ksh -o emacs". How can i make it auto startup?
thks

Adam
7 REPLIES 7
Venkatesh BL
Honored Contributor

Re: auto startup a script when bootup

You could add this to the '.profile' file of the user, so that it gets executed when the user logs in.
adam yeong
Occasional Advisor

Re: auto startup a script when bootup

Hi BL,
Is it means putting that script with "ksh -o emacs" into that user profile? Is yes, how about enable for all user?

Regards,

Yeong
Mark Poeschl_2
Honored Contributor

Re: auto startup a script when bootup

If your users have 'ksh' set as their login shell (see /etc/passwd) you can include the line 'set -o emacs' in the /etc/profile file to get this functionality turned on for all users when they log in.
adam yeong
Occasional Advisor

Re: auto startup a script when bootup

Hi Mark,
Thks for the advice and guide. I had already try and it work successfully. If i want to put a script and want the script auto run once it boot, where should i save the script?

thks

Yeong
Kapil Jha
Honored Contributor

Re: auto startup a script when bootup

Hello Adam,
I think you can put in inittab file where you can also put in which runlevel it would run.And you'll have to put the script at the end of inittab file(not in between...)
Kapil
I am in this small bowl, I wane see the real world......
Mark Poeschl_2
Honored Contributor

Re: auto startup a script when bootup

I would save your script to /sbin/init.d and then create a link to /sbin/rc3.d. Everything in /sbin/rc3.d that starts with an 'S' is run (in numerical order) when the system transitions to run level 3.

#ln -s /sbin/init.d/myscript /sbin/rc3.d/S99myscript
adam yeong
Occasional Advisor

Re: auto startup a script when bootup

Hi all!
thks for the advice and help!. I will try up the step given.

Can anyone explain to me in vmstat the was a CPU% ultilization but sometimes, only 1 process can up to 9++% while there have another process running. How the CPU ultilization calculate (My server having 6 CPU with 1000MHz).

thks

Ragards.

Adam