rc3.d - source: not found


 
Thread Tools Search this Thread
Operating Systems Solaris rc3.d - source: not found
# 1  
Old 03-11-2008
rc3.d - source: not found

Hello,
I have troubles with running a service at the boot of Solaris 9. I have a link in /etc/rc3.d/ to my script which I want to run. :
Code:
/etc/rc3.d/S90myService

In this script, I fist "source" an config file to get some environments values
Code:
#!/bin/bash
...
source /my/dir/myenv 
...

But this seems to fail. This is the log during the boot:
Code:
/etc/rc3.d/S90myService: source: not found

It looks like the system is using sh instead of bash !

Any ideas about this problem ?

Thanks in advance,
regards,
Tex

Last edited by Tex-Twil; 03-11-2008 at 08:16 AM..
# 2  
Old 03-11-2008
Remove "source" and use the dot operator "."

Cheers,
ZB
# 3  
Old 03-11-2008
Hello zazzybob,
thanks for the advice it seems to work better but could you explain me yhat is the difference ?

Actually, If I use "." instead of "source" the file seems to be sources but I have some syntax error during the sourcing of the file.

For example, in my sourced file I have :
Code:
function myEnv
{
 ....
}

MY_VAR="..."
myEnv

The error I get then is
Quote:
/etc/rc3.d/S90myService: function: not found
Thanks,
Tex

Last edited by Tex-Twil; 03-11-2008 at 10:04 AM..
# 4  
Old 03-11-2008
You need to use plain old bourne shell syntax in rc scripts unless you explicitly give them the .sh extension.

Rename S90myService to S90myService.sh and that should work, including the source statement.
# 5  
Old 03-11-2008
Quote:
Originally Posted by jlliagre
You need to use plain old bourne shell syntax in rc scripts unless you explicitly give them the .sh extension.

Rename S90myService to S90myService.sh and that should work, including the source statement.
Hi jlliagre,
In fact, the S90myService file is a sym link to /etc/init.d/myService.sh.

I renamed the link S90myService to S90myService.sh and the source call to
Code:
source /my/dir/myenv.sh

but I still have the same problems ( source not found, syntax errors in the myenv.sh).

Tex.
# 6  
Old 03-11-2008
How do you run the S90myService.sh script ?
# 7  
Old 03-11-2008
For testing I run
Code:
/sbin/rc3

to run all run level 3 scripts. S90myService.sh is part of them. Actually, it is a link to the real script :

Code:
# ll /etc/rc3.d/S90*
lrwxrwxrwx   1 root     other         22 Mar 11 14:57 /etc/rc3.d/S90myService.sh -> /etc/init.d/myService.sh

T.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. OS X (Apple)

[Solved] links2 --enable-graphics from source, configure error: no graphics driver found.

Howdy I am trying to install links2 with graphics support on snow leopard 10.6.8 (xcode installed). I have had the program running last year, also installed from source - but then I had installed some image libraries with mac ports and fink - cannot reproduce that setup. Plus I would like to not... (6 Replies)
Discussion started by: butterbaerchen
6 Replies

2. HP-UX

bash...Not found through where(compiling source file)

Hi i have compiled and installed bash 3.2 on my hp-ux parisc its in path /usr/local/pkg/bash/bin/bash .....When im search for this bash (through whereis bash) im not findind but other which i hve done in same procedure( gettext,m4) ..Im able to find through whereis search option can any1... (3 Replies)
Discussion started by: vasanthan
3 Replies

3. Debian

Kernel source not found. (can't install network card drivers)

I've had no luck with help on linuxquestions so I figured I'd try here. I'm using debian etch. The problem is that I can not install my network card because it says: Makefile:62: *** Linux kernel source not found. Stop. I have the kernel-headers installed. I've looked all over the... (9 Replies)
Discussion started by: Virtuality
9 Replies

4. Shell Programming and Scripting

how can i check in csh if command found or not found ?

hello all im trying to use in sun Solaris the information received from the top command now i several machines that dont have install the top program so when im running the script im geting error saying after im running this code : set MemoryInfo = `top | grep Memory` if (... (2 Replies)
Discussion started by: umen
2 Replies
Login or Register to Ask a Question