main() caught exception: error executing ifconfig

[ARCHIVED] About PearPC, a mostly obsolete PPC Mac emulator for Windows and Linux to run MacOS X 10.1 up to 10.4. Using QEMU is now recommended.

Moderators: Cat_7, Ronald P. Regensburg

Locked
morneo
Space Cadet
Posts: 5
Joined: Sun Apr 10, 2005 12:42 am

main() caught exception: error executing ifconfig

Post by morneo »

Hi all,
I was able to install osx 10.3 on fc3 using pearpc and it works fine. Th eproblem iam facing is with the networking part.when i try to start pearpc it gives the following error message
GenuineIntel
CMOV MMX 3DNOW SSE SSE2
fork = 0, 0x00000000
executing 'scripts/ifppc_up.setuid' ...
********************************************************************************couldn't exec 'scripts/ifppc_up.setuid': No such file or directory
fork = 15875, 0x00000000
program terminated with exit code 1
main() caught exception: error executing ifconfig.

I looked through the scripts folder under ppc and it shows the following files in it

[root@xxxx scripts]# ls -l
-r-xr-xr-x 1 root root 171 May 7 2004 ifppc_down
-rwxr-xr-x 1 kn root 171 Jun 13 2004 ifppc_down.beos
-r-sr-xr-x 1 root root 11630 Apr 9 17:47 ifppc_down.setuid
-rw-r--r-- 1 kn root 1922 May 5 2004 ifppc_down.setuid.cc
-rw-r--r-- 1 kn root 8540 Apr 9 17:47 ifppc_down.setuid.o
-r-xr-xr-x 1 root root 416 May 7 2004 ifppc_up
-rwxr-xr-x 1 kn root 305 Jun 13 2004 ifppc_up.beos
-r-sr-xr-x 1 root root 11596 Apr 9 17:47 ifppc_up.setuid
-rw-r--r-- 1 kn root 1960 May 5 2004 ifppc_up.setuid.cc
-rw-r--r-- 1 kn root 8484 Apr 9 17:47 ifppc_up.setuid.o
-rw-r--r-- 1 kn root 13721 Apr 9 17:46 Makefile
-rw-r--r-- 1 kn root 303 Jun 21 2004 Makefile.am
-rw-r--r-- 1 kn root 14897 Sep 5 2004 Makefile.in


Can anyone please help me.
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hello,

You should run Pear as root.

Did you execute these commands in the scripts folder?

chmod a-w ifppc_up ifppc_down ifppc_up.setuid ifppc_down.setuid
chown root ifppc_up ifppc_down ifppc_up.setuid ifppc_down.setuid
chmod u+s ifppc_up.setuid ifppc_down.setuid

take a look here: http://pearpc.sourceforge.net/netsetup.html
(not al of the information there is still correct. f.e.: Pearpc now used bridging to network)

Cat_7
morneo
Space Cadet
Posts: 5
Joined: Sun Apr 10, 2005 12:42 am

Post by morneo »

Hi cat_7
i am running pearpc ar root and i also executed the commands you asked me to. But i still have the same problem. Do u think maybe it is not able to find ifppc_up.setuid even though it is in the pearpc-0.3.1/scripts folder
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

The error you got seems to suggest that conclusion.

Have you tried with a newer pearpc build? There have been some changes to the networking scripts in the past.

Cat_7
morneo
Space Cadet
Posts: 5
Joined: Sun Apr 10, 2005 12:42 am

Post by morneo »

I even tried removing pearpc and recompiling and configuring it again. Still has the same problem. By the way i use linux in fact i use fedora core 3. Is there any new version other than pearpc-0.3.1 for linux? If so where can i get it

ThankYou
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

You can download the source from the pearpc cvs

go to a directory where you would like the source to be placed in and
use these commands to get it:

cvs -z 4 -d:pserver:anonymous@cvs.sf.net:/cvsroot/pearpc login
(hit enter after this)
cvs -z 4 -d:pserver:anonymous@cvs.sf.net:/cvsroot/pearpc \co pearpc

cd to pearpc and enter "./autogen.sh". After that, enter "make"
You should then have a build from the latest source in pearpc/src

good luck,
cat_7

edit: I have reproduced your error. When I use an ppc-altivec build from recent sources it also spits out the error you reported. Not so for a normal build of pearpc. This definately suggests and error in the scripts, that has been repaired in the newest sources, though not in the altivec source. I believe there is going to be a merge of both source trees soon.
morneo
Space Cadet
Posts: 5
Joined: Sun Apr 10, 2005 12:42 am

Post by morneo »

Hi cat_7

I downloaded the latest build and installed it. This is what i get when i try to start pearpc with network support.

GenuineIntel
CMOV MMX SSE SSE2
ppc0: error fetching interface information: Device not found
mIfName = ppc0
UnixTun::execIFConfigScript(up,ppc0)
executing 'scripts/ifppc_up.setuid' ...
********************************************************************************
couldn't exec 'scripts/ifppc_up.setuid': No such file or directory
program terminated with exit code 1
main() caught exception: error executing ifconfig
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Can you execute the scripts from the scripts directory themselves?

And do you have the bridge controle package installed? I believe it's called brctl or something similar.

Cat_7
morneo
Space Cadet
Posts: 5
Joined: Sun Apr 10, 2005 12:42 am

Post by morneo »

I tried to run ifppc_up and ifppc_up.setuid from the pearpc/scripts folderand got the following output

[root@Alien scripts]# ./ifppc_up
UID=0
./ifppc_up: line 8: ./scripts/settings: No such file or directory
SIOCSIFNETMASK: No such device
SIOCGIFADDR: No such device
SIOCSIFBROADCAST: No such device
192.168.1.80: unknown interface: No such device

when i comment the . ./scripts/settings in the ifppc_up file i get the following output
[root@Alien scripts]# ./ifppc_up
UID=0
SIOCSIFNETMASK: No such device
SIOCGIFADDR: No such device
SIOCSIFBROADCAST: No such device
192.168.1.80: unknown interface: No such device

[root@Alien scripts]# ./ifppc_up.setuid
UID=0
/home/kiran/pearpc/scripts/./ifppc_up: line 8: ./scripts/settings: No such file or directory

when i comment the . ./scripts/settings in the ifppc_up file i get the following output
[root@Alien scripts]# ./ifppc_up.setuid
UID=0
./ifppc_up: line 8: ./scripts/settings: No such file or directory
SIOCSIFNETMASK: No such device
SIOCGIFADDR: No such device
SIOCSIFBROADCAST: No such device
192.168.1.80: unknown interface: No such device

This is what my ifppc_up file looks like
#
# BE CAREFUL. THIS SCRIPT IS INVOKED BY A SETUID ROOT BINARY!
# IT SHOULD BE OWNED BY ROOT.
# ONLY ROOT SHOULD HAVE WRITE-ACCESS TO THIS FILE.
#
echo UID=$UID

. ./scripts/settings

if [ $BRIDGE ]; then
touch $PPC_INTERFACE.active
ifconfig $BRIDGE_INTERFACE 1>/dev/null 2>&1
if [ $? != 0 ]; then
ifconfig $HOST_INTERFACE 0.0.0.0
ifconfig $PPC_INTERFACE 0.0.0.0
brctl addbr $BRIDGE_INTERFACE
brctl addif $BRIDGE_INTERFACE $HOST_INTERFACE
brctl addif $BRIDGE_INTERFACE $PPC_INTERFACE
ifconfig $BRIDGE_INTERFACE $HOST_IP netmask $HOST_NETMASK up
route add -net default gw $HOST_DEFAULT_ROUTER
else
ifconfig $PPC_INTERFACE 0.0.0.0
brctl addif $BRIDGE_INTERFACE $PPC_INTERFACE
fi
else
PPC_NETMASK="255.255.255.0"
PPC_HOST_IP="192.168.1.80"
PPC_CLIENT_IP="192.168.1.1"
/sbin/ifconfig $PPC_INTERFACE $PPC_HOST_IP netmask $PPC_NETMASK up &&\
/sbin/iptables -t nat -s $PPC_CLIENT_IP -A POSTROUTING -j MASQUERADE &&\
echo 1 > /proc/sys/net/ipv4/ip_forward
fi

I downloaded bridge control utilities form http://bridge.sourceforge.net/index.html and did a ./configure && make .

when i try brctl from the
home/xxxx/bridgeutils/brctl/ directory it works.

Am i doing anything wrong? And when i try to reun pearpc again it shows the following

GenuineIntel
CMOV MMX SSE SSE2
ppc0: error fetching interface information: Device not found
mIfName = ppc0
UnixTun::execIFConfigScript(up,ppc0)
executing 'scripts/ifppc_up.setuid' ...
********************************************************************************couldn't exec 'scripts/ifppc_up.setuid': No such file or directory
program terminated with exit code 1
main() caught exception: error executing ifconfig.

update: i even tried replacing the . ./scripts/settings line in ifppc_up file witht the exact location of the file i.e
/homw/xxxx/pearpc/scripts/settings
when i try ifppc_up after adding that line i get

[root@Alien scripts]# ./ifppc_up
UID=0
SIOCSIFNETMASK: No such device
SIOCGIFADDR: No such device
SIOCSIFBROADCAST: No such device
192.168.1.80: unknown interface: No such device

similarly when i try ifppc_up.setuid i get
[root@Alien scripts]# ./ifppc_up.setuid
UID=0
SIOCSIFNETMASK: No such device
SIOCGIFADDR: No such device
SIOCSIFBROADCAST: No such device
192.168.1.80: unknown interface: No such device

whe i run pearpc i get the following
GenuineIntel
CMOV MMX SSE SSE2
sh: ifconfig: command not found
mIfName = ppc0
UnixTun::execIFConfigScript(up,ppc0)
executing 'scripts/ifppc_up.setuid' ...
********************************************************************************couldn't exec 'scripts/ifppc_up.setuid': No such file or directory
program terminated with exit code 1
main() caught exception: error executing ifconfig.

Sorry for the long post. I wanted to make sure u get the complete info. i feel that when iam running pearpc it is pointing to the wrong file location for ifppc_up.setuid. maybe thqt is the reason it saus no such file or directory.

Thanks
lemango
Space Cadet
Posts: 1
Joined: Tue Nov 29, 2005 5:26 pm

Some solutions...

Post by lemango »

This has annoyed me for ages now... so a few things that might fix it for you (I'm on Mandriva 2006)

1. Try getting rid of shorewall if it's running (rpm -e shorewall) and it's not essential to you. My desktop computer is already on a network behind a firewall so I don't need it. I also reinstalled iptables after I did this.

2. Try adding a small sleep command to the scripts/ifup_ppc file before it tries to initialize the connection.

Hope you have some luck with it....
Locked