A new message in this topic for the init scriptFirst problem, on our setup wget is not in the default
root path, it is in /usr/sfw/bin. To fix this I added:
PATH=/usr/bin:/usr/sbin:/usr/sfw/bin
|
Issue 2, grep:Grep: grep -qai - this uses GNU grep specific options.
Again Solaris has multiple grep options:
/usr/xpg4/bin/grep - supports -q and -i /usr/sfw/bin/ggrep - supports -qai (ggrep == GNU grep) /usr/bin/grep - only support -i
|
Issue 3, ps:The init script uses:
pslist=`ps ax --width=2000 | grep "$STARTGREPTEXT" | grep -v PID | awk ''{printf $1 " "}''`
|
This ps style is BSD specific (ps aux vs. ps -ef for SysV) and --width is GNU ps specific.
Solaris has two ps binaries:
/usr/bin/ps - Solaris traditional/SysV ps /usr/ucb/ps - BSD ps
|
The standard /usr/bin/ps does not report more than 80 characters
of executable and arguments - probably for historical compatibility
reasons. The classname being grep was outside the 80 chars.
pargs may provide a work around.
The BSD ps, when run with the right permissions, can do >80.
So my fix was:
pslist=`/usr/ucb/ps axww | grep "$STARTGREPTEXT" | grep -v PID | awk ''{printf $1 " "}''`
|
Issue 4, date formats:+%s is not a standard format string for strftime/date - again
probably a GNU extension. Neither /usr/bin/date or /usr/xpg4/bin/date
support this. A work around is to use perl:
< local starttime=`date +"%s"` --- > local starttime=`perl -le ''print time''`
|
Issue 5, invocation/redirection:There were also a couple of problems with the command used for
the actual NK invocation. Firstly --shell is specific to GNU
su - I think the default behaviour is to use the shell specified
for the user in /etc/password - I made this /bin/sh
Another problem was that the stdout/stderr output was appearing
on the terminal and not into the log file.
I suspect that &> and the 2>&1 ways of redirection overlap
(in bash), but the command is being run in /bin/sh
which on Solaris is not /bin/bash and does not support &>
(I think).
My su changes were:
< exec su - -p --shell=/bin/sh $NK_USER -c "$RUNCOMMAND &>\\"$LOGFILE\\"" 2>&1 & --- > exec su $NK_USER -c "$RUNCOMMAND > $LOGFILE 2>&1" &
|
That was about it - hope someone finds this useful one day.
Cheers,
Nigel
[/u]