1753943 Members
8506 Online
108811 Solutions
New Discussion юеВ

Re: ps: option

 
SOLVED
Go to solution
P-Dicky
Frequent Advisor

ps: option

Good Morning,

Hoping this is a simple fix not a scripting guy.. Here is the error I am getting.

# ./startwrx

Starting WRX System.

Give it some time Starting up WRX
ps: option requires an argument -- u
usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup] [-Z psetidlist]
line
usage: kill [ -signo ] pid ...
[root:testomni:/usr2/amv/cmd]
#
9 REPLIES 9
Patrick Wallek
Honored Contributor
Solution

Re: ps: option

The '-u' option requires either a numeric UID or a userid as an option.

The script you attached says it is doing a 'ps -u ${PROJECT_NAME}....' but I do not see the ${PROJECT_NAME} defined in the first few lines of the script.

You need to get that variable defined appropriately before the script will work.
Mel Burslan
Honored Contributor

Re: ps: option

In your attached script, there is a reference to a environment variable called PROJECT_NAME and it is not defined. Your ps command is complaining about this null variable as the -u option requires this variable to be set.
________________________________
UNIX because I majored in cryptology...
James R. Ferguson
Acclaimed Contributor

Re: ps: option

Hi:

Most notably, the variables 'PROJECT_NAME' and 'PROJECT_DIR' are never set. This cause the usage error you get.

A useful protection against chasing things like this is to begin you script like:

#!/usr/bin/ksh
set -u
...

Regards!

...JRF...
P-Dicky
Frequent Advisor

Re: ps: option

Sorry ${PROJECT_NAME} was not set... They are both set in .profiles

I have corrected this but I'm now stuck at this

# ./startwrx

Starting WRX System.

Give it some time Starting up WRX
line

Mel Burslan
Honored Contributor

Re: ps: option

Since the line you said you are stuck at, is not in the script itself, I am under the impression that your application is spitting this message. Without knowing what this executable located at ${PROJECT_DIR}/amv/bin/utdbu is, it is almost impossible to say why you are stuck at this point.

If you have support agreement with the vendor of this software, I'd strongly suggest contacting them.
________________________________
UNIX because I majored in cryptology...
Patrick Wallek
Honored Contributor

Re: ps: option

>>Give it some time Starting up WRX

>>Since the line you said you are stuck at, is not in the script itself,

Actually, it is.

Here's the section of the script that's causing the delay....

while [ "$systat" -ne "START" ]
do
if [ "$firsttime" != "TRUE" ]; then
if [ $waittime -le 0 ]; then
echo " Unable to Start WRX System! " 1>&2
exit 1
fi

# wait for a bit
sleep $sleeptime
waittime=`expr $waittime - 1`
fi

firsttime="FALSE"

echo "gc\nf\n2\n\nq\nq\n" | ${PROJECT_DIR}/amv/bin/utdbu |
while read line
do
firstarg=`echo $line | awk '{print $1}'`
if [ "$firstarg" = "cnflng" ]; then
systat=`echo $line | awk '{print $4}'`
fi
done
done


It appears that this attempts to start whatever this is. It gets the status of the process via the 'systat=' line above. If systat is not equal to START, then it will wait and try again. Each time through the script the "waittime" is decremented by 1. So, it will run through the script '90' times, sleeping 10 seconds each time (if I am figuring correctly), so you have a potential delay of 900 seconds (15 minutes) if the system is not starting correctly.
Tarun Kumra
Esteemed Contributor

Re: ps: option

As said by Patrick and Mark, you will need to assign some value to the variable PROJECT_NAME.

Regards
Tarun
P-Dicky
Frequent Advisor

Re: ps: option

Starting to make sense thank you all.
P-Dicky
Frequent Advisor

Re: ps: option

Close, reply... So close. Thanks Again