Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have installed oversip & when i try to execute the command "oversip" from shell,

[root@vhost1111 ~]# oversip
NOTICE: <executable> OverSIP 1.3.8 starting...

it gets executed. But when i put that command in a shell script and then run the shell script. It says command not found.

[root@vhost1111 ~]# ./ start
Switch to user oversip
Starting oversip: ./ line 21: oversip: command not found

----Oversip Path----

[root@vhost1111 idcuser]# which oversip


[root@vhost1111 idcuser]# echo $PATH

Contents of

PID="--pid /var/run/oversip/ -u oversip";
if [ ! -d /var/run/oversip ]; then
mkdir -p /var/run/oversip
if id -u oversip >/dev/null 2>&1; then
echo "Switch to user oversip";
adduser -u 106 -g 99 --shell /bin/false -b /var/run oversip
chown oversip /var/run/oversip 

. /etc/rc.d/init.d/functions
case "$1" in
echo -n "Starting oversip: "
oversip $PID
touch /var/lock/subsys/oversip
echo -n "Shutting down oversip ??: "
killproc oversip
rm -f /var/lock/subsys/oversip
status oversip
if [ -f /var/lock/subsys/oversip ]; then
$0 stop
$0 start 
$0 stop
$0 start
echo "destroy existing connections during a restart."
echo "Usage: $0 {start|stop|restart|status}"
exit 1
exit 0

I added 'type oversip' and also 'which oversip' in the script: Below is the output for both.

./ line 20: type: oversip: not found
which: no oversip in (/sbin:/usr/sbin:/bin:/usr/bin)
share|improve this question
Where is the executable oversip ? (output which oversip) It looks like it is in the root PATH, but not in the PATH of user oversip. – Levans Jul 23 '13 at 7:35
can you post the contents of or at least the line that calls oversip. also do this command which overship from your shell and tell us the results. – booyaa Jul 23 '13 at 8:03
I have updated the question with the output of 'which oversip' and contents of $PATH. – Ashish Jul 23 '13 at 8:44
And about the content of, and the $PATH of user oversip ? These are the relevant things here. – Levans Jul 23 '13 at 8:49
Try adding type oversip; which oversip immediately before echo -n "Starting oversip: " under start) in that script. I'm willing to bet it's a simple path issue, and that will confirm it. If so, it might be as simple as specifying the full path to the executable. (You might also want to echo $PATH and $LD_LIBRARY_PATH, the latter if the software requires any particular libraries of its own.) You may need to promote the script to use /bin/bash rather than /bin/sh for type to work, but I think you'll be OK as it is. – Michael Kjörling Jul 23 '13 at 9:02

Your init script tells you

which: no oversip in (/sbin:/usr/sbin:/bin:/usr/bin)

Your shell tells you

# which oversip

What directory do you think you need to add to the PATH in the init script?

share|improve this answer
I added: export PATH=/usr/local/rvm/gems/ruby-1.9.2-p320/bin/:$PATH to the init script , but it is still not working. – Ashish Jul 24 '13 at 6:55
When i check $PATH from init script it shows PATH contents as given in the updated question. But when i do which oversip, why does it show : no oversip in (/sbin:/usr/sbin:/bin:/usr/bin) , what is /sbin:/usr/sbin:/bin:/usr/bin ? ,as it dosent match with my $PATH contents. – Ashish Jul 24 '13 at 7:02

Your Answer


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.