Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following script:

cd "/usr/local/bin/"     
/sbin/startproc ./program1

I have a license in the /usr/local/bin directory and if the program isn't started from there it won't launch correctly.

The cd "/usr/local/bin" doesn't seem to be doing the trick.

share|improve this question
    
a note aside: .../bin directories aren't supposed to host anything but runnable commands. Please consider moving the license files to a more suitable location like .../etc or .../share or something. –  yarek May 11 '12 at 21:39

2 Answers 2

Taking a peek at startproc's man page, it looks like it wants full path.

Have you tried the cd and specifying the full directory, like so?

cd /usr/local/bin
startproc /usr/local/bin/program1

On thing I'd do afterwards is add the following line immediately after the startproc line;

echo -e "exit code is $?"

That can tell you what error startproc is throwing, and what the problem might be, according to this exit code list for the program:

0 Success
1 Generic or unspecified error
2 Invalid or excess argument(s)
4 Insufficient privilege(s)
5 Program is not installed
7 Program is not running

That should give you a better peek into what's up if the full path doesn't work.

share|improve this answer

You haven't said anything about the kind of system you're doing this on, but typically a utility with a name like startproc does its own setup — often including setting a default directory. I suggest you find your system's documentation for startproc and see how to make it do what you need, or failing that startproc the script that changes directory.

share|improve this answer
    
sorry this is on ubuntu 11.04. I will try to startproc the cd "/usr/local/bin" and see if that works –  rahrahruby May 11 '12 at 21:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.