Operating System - HP-UX
1756974 Members
1685 Online
108857 Solutions
New Discussion юеВ

Re: start up script in user's profile.

 
Deoncia Grayson_1
Honored Contributor

start up script in user's profile.

I know you add a start up script when you add a user to the server but I need the start up script to be like so ...

/main/bin/c01735 main 109 245 and Sam won't allow you to add the scrip like so but I need this to take place, how should I accomplish this task?
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
6 REPLIES 6
Eric Antunes
Honored Contributor

Re: start up script in user's profile.

Hi,

Why you don't create a script c01735.sh with the following inside:

/main/bin/c01735 main 109 245

And tell SAM to execute c01735.sh (check the file is executable)

Best Regards,

Eric Antunes

Each and every day is a good day to learn.
Jan Sladky
Trusted Contributor

Re: start up script in user's profile.

Hi Deoncia,

I'm not sure what are you exactly talking about, can you describe it in more details ?

generaly you can use and modify template startup script according to /sbin/init.d/template. Don't forget to make S a K links to this script from level you want to start from.

rgds Jan
GSM, Intelligent Networks, UNIX
Deoncia Grayson_1
Honored Contributor

Re: start up script in user's profile.

Hey Eric

followed your suggestion and wrote a simple script but now getting variable is not set properly so I set up the variable like so

CAT_HOME=/main
export CAT_HOME

guess what it comes back with.. CAT_HOME is not set in environment so decided to do setenv ENV $CAT_HOME/main and get CAT_HOME is not set... any suggestions?
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
A. Clay Stephenson
Acclaimed Contributor

Re: start up script in user's profile.

What is this user's shell? How are you logging in as this user. For example, it this a CDE login or a terminal session?

If you put a script inside the user's .profile it must be sourced with the "." command.

Let's assume you have a small script, myvars.sh:

XX=123456
export XX

For example, in the profile suppose you do this:

myvars.sh

In this case, the .profile will execute myvars.sh perfectly BUT because this is executed as a child process the exports will have absolutely no effect upon the parent shell. You need to source the script so that the myvars.sh script becomes a part of .profile.

. myvars.sh

This will work as intended BUT myvars.sh must contain no exit or return statements because you will now exit the foreground process (the shell).

If it ain't broke, I can fix that.
Deoncia Grayson_1
Honored Contributor

Re: start up script in user's profile.

I've tried doing the way you suggested and I'm still getting an environment error.

main/bin/c01735: error: CAT_HOME not set in environment.
REFERENCE CODE: c05279-1000

any more suggestions?
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Deoncia Grayson_1
Honored Contributor

Re: start up script in user's profile.

off to programmers... some information need to be hard coded in the user's profile
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon