- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- rc.config Syntax error
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2007 05:53 PM
тАО04-10-2007 05:53 PM
rc.config Syntax error
I tried to manually started it:
root:/etc #ll rc.config
-r--r--r-- 1 root sys 636 Apr 11 00:34 rc.config
root:/etc #./rc.config
sh: ./rc.config: Execute permission denied.
I changed permissions to allow execution to everybody
root:/etc #chmod 777 rc.config
root:/etc #./rc.config
./rc.config[13]: Syntax error at line 3 : `(' is not expected.
now i get this weird error saying that there's a syntax error on the rc.config file, i have already checked and replace this file with another one (the one on /usr/newconfig/etc/rc.config) but still got the same problem.
just by looking at the file I can't find anything wrong with it, can somebody help me find the source of the problem (see rc.config attachment)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2007 06:12 PM
тАО04-10-2007 06:12 PM
Re: rc.config Syntax error
(script fragment, actually) does not specify
the shell to be used to process it. With a
plain "#", you might be getting a C shell, or
who knows what?
Script fragments like this are normally fed
to the shell of your choice, for example:
sh ./rc.config
And for that, you don't need execute
permission.
That may not make your script (fragment) work
properly, but it should get it executed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2007 06:46 PM
тАО04-10-2007 06:46 PM
Re: rc.config Syntax error
sh rc.config
you may try entering
echo Done
in last of the your rc.config to check for execution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2007 06:48 PM
тАО04-10-2007 06:48 PM
Re: rc.config Syntax error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2007 07:08 PM
тАО04-10-2007 07:08 PM
Re: rc.config Syntax error
# . ./rc.config
If you replaced by the one it newconfig, you should be fine. This file should not be changed, only the files under /etc/rc.config.d/.
Note line 13 is sourcing files in rc.config.d/ and it could be a file there that has that "(" syntax error.
I assume you know, you can't have any left over files in that directory??
You could also add "set -x" to rc.config to see which file in rc.config.d/ has the problem, then remove that -x.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2007 07:21 PM
тАО04-10-2007 07:21 PM
Re: rc.config Syntax error
How do u know that there is problem with ur
/etc/rc.config ?
If u r experienceing problem with hostname then
it cound be some configuration errors (HOSTNAME)
in the file /etc/rc.config.d/netconf.
Check this and also restore permissions of
/etc/rc.config.
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2007 08:01 PM
тАО04-10-2007 08:01 PM
Re: rc.config Syntax error
/etc/rc.config doesnot require execute permissions.
This file is executed by init and executed in the
same shell
eg.
# . /etc/rc.config
will execute the file in same shell so that all
the env. variables are available in the present
shell.
Also as u have told below
root:/etc #./rc.config
./rc.config[13]: Syntax error at line 3 : `(' is not expected.
Line no. 13 is
if [ -f $CFG_FILE -a "$fname" != "core" -a "${fname##*[.,~\#]}" = "$fname" ]
nowhere '(' sign.
So I suggest u to verify /etc/rc.config.d/netconf
and set HOSTNAME parameter in that file
and reboot the machine. If u don't want to
reboot u can temporarily set hostname as
# hostname
but it will vanish after a reboot, so
set HOSTNAME in /etc/rc.config.d/netconf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2007 08:02 PM
тАО04-10-2007 08:02 PM
Re: rc.config Syntax error
As others already have replied this file isn't meant to be executed but to be sourced.
As you can easiliy verify the sourcing of rc.config actually happens here:
# grep -n rc\.config /sbin/rc
58:# If /etc/rc.config contains default information (first boot),
66:if [ -f /etc/rc.config ]; then
67: . /etc/rc.config
76: echo "\nWARNING: /etc/rc.config does not exist"
rc.config isn't meant to be tampered with at all.
So it was a good decision to copy the original from newconfig back in place.
Your syntax error most likely results from any of your files in /etc/rc.config.d
What you could do to possibly identify the culprit may be this:
# cd /etc/rc.config.d
# echo *|xargs -n1 sh -n 2>&1|grep -v permission\ denied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2007 08:03 PM
тАО04-10-2007 08:03 PM
Re: rc.config Syntax error
/etc/rc.config doesnot require execute permissions.
This file is executed by init and executed in the
same shell
eg.
# . /etc/rc.config
will execute the file in same shell so that all
the env. variables are available in the present
shell.
Also as u have told below
root:/etc #./rc.config
./rc.config[13]: Syntax error at line 3 : `(' is not expected.
Line no. 13 is
if [ -f $CFG_FILE -a "$fname" != "core" -a "${fname##*[.,~\#]}" = "$fname" ]
nowhere '(' sign.
So I suggest u to verify /etc/rc.config.d/netconf
and set HOSTNAME parameter in that file
and reboot the machine. If u don't want to
reboot u can temporarily set hostname as
# hostname
but it will vanish after a reboot, so
set HOSTNAME in /etc/rc.config.d/netconf
if u want to set it parmenant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2007 01:43 AM
тАО04-11-2007 01:43 AM
Re: rc.config Syntax error
Thanks