# /sbin/ifconfig or /bin/ifconfig?

## shallpion

Recently I did an update on my gentoo ~amd64 system, and realized that my openvpn stopped working. I read the log and realized that the problem is rather odd:

 *Quote:*   

> 
> 
> Tue Jul  3 14:53:53 2012 /sbin/ifconfig tap1 10.8.0.1 netmask 255.255.255.0 mtu 1500 broadcast 10.8.0.255
> 
> Tue Jul  3 14:53:53 2012 Linux ifconfig failed: could not execute external program
> ...

 

It took me a few minutes to realize that /sbin/ifconfig does not exist at all.  On the other hand there is /bin/ifconfig coming from net-tools. So I created a link to resolve this problem. I still have no idea how this happened because neither openvpn or net-tools were touched during the last update. 

Is there anything wrong>?

Thanks in advance.

----------

## khayyam

 *shallpion wrote:*   

> It took me a few minutes to realize that /sbin/ifconfig does not exist at all.  On the other hand there is /bin/ifconfig coming from net-tools.

 

shallpion ... ifconfig is in the process of being moved from /sbin to /bin, the effected packages are still currently ~arch. The Changelog states:

 *Quote:*   

> 11 Mar 2012; Robin H. Johnson <robbat2@gentoo.org>
> 
> net-tools-1.60_p20120127084908.ebuild:
> 
> You must have openrc 0.9.9.3 or newer due to the ifconfig move

 

So, probably your openrc is < 0.9.9.3

best ... khay

----------

## shallpion

Thanks khayyam, I checked my openrc and it is 0.10.3. 

Maybe my feeling that it "used to work well" is not precise. It is possible that I haven't used openvpn for a while.

----------

## khayyam

shallpion ...

In which case I could only really guess at what the problem might be, and with the symlink to /sbin it should behave as before. If you've had a kernel update since last use then that would probably be the most obvious starting point.

best ... khay

----------

## shallpion

I actually touched nothing during the last two month, except the update I made a couple of days ago.

Right now I can only guess that my memory made a joke with me...

Thanks

----------

## bell

Now I have the same problem on my Gentoo-stable-x86 Firewall too.

Openrc is 0.11.5

iptables is 1.4.16.3

openvpn is 2.2.2

What can I do?

----------

## olivier-lonzi

For my part, I have the problem with openvpn !

Just do : emerge -av openvpn !

And that's work  :Smile: 

Try to re-emerge openrc and iptables !

Best Regards,

Oliver.

----------

## Yuu

 *olivier-lonzi wrote:*   

> Just do : emerge -av openvpn !
> 
> 

 

Thank you for your reply Olivier, that's working for me. I was about to fill a bug on bugs.gentoo.org.

 *Quote:*   

> Sun Nov 25 21:38:17 2012 TUN/TAP device tun0 opened
> 
> Sun Nov 25 21:38:17 2012 TUN/TAP TX queue length set to 100
> 
> Sun Nov 25 21:38:17 2012 /bin/ifconfig tun0 14.32.90.24 netmask 255.255.255.192 mtu 1442 broadcast 14.32.90.24
> ...

 

----------

## olivier-lonzi

ok perfect  :Smile: 

You havve re-emerge juste openvpn, or more ? (For all other people wants to know)

Do not forget to pass your Thread in Resolved !

----------

## Yuu

@olivier-lonzi : I just re-emerged openvpn.

```
# emerge -v1 net-misc/openvpn
```

It worked fine on my two Gentoo boxes  :Smile: 

I hope that this nice solution will solve shallpion's problem too.

----------

## jamapii

For me, it's vtun that breaks, and my own scripts. The net-tools that introduced the change is now "stable".

I made a script to work around current and future net-tools changes:

```
#!/bin/sh

grep -E "^obj /s?bin/" /var/db/pkg/*-*/net-tools-*/* | cut -d" " -f2 |

  while read file; do

    prog=$(basename $file)

    bin=/bin/$prog

    sbin=/sbin/$prog

    [ -e $bin -a -e $sbin ] && continue

    if [ $file = $bin ]; then

      file2=$sbin

    else

      file2=$bin

    fi

    echo ln -s $file $file2

  done

```

remove the echo to actually do it.

----------

## CMoH

One alternative would make a (sym)link or to place this in /sbin:

```
#!/bin/sh

/bin/ifconfig $@

```

----------

## faemin

...Last edited by faemin on Sun Dec 02, 2012 9:39 pm; edited 1 time in total

----------

## mv

 *faemin wrote:*   

> Isn't sbin supposed to contain utilities needed by the kernel before dynamic libraries are loaded?

 

Both /sbin and /bin are meant for this (well - used to be before the systemd nonsense, but this is a different story).

The practical difference between /sbin and /bin is that /sbin is in the root path but not in the user path. Which was bad, because also the user might want to call ifconfig to see information.

----------

## Hu

As mv noted, /sbin is traditionally only in the path of root.  The value was that there exist commands which cannot be usefully run by unprivileged users, such as LVM administration commands, so there is no point in polluting the unprivileged user path with commands that will fail when executed.  However, some commands, such as ifconfig can be usefully run by unprivileged users to read state, so there is value in moving them to /bin.

----------

## RayDude

Thanks for this thread, you saved me lots of time...

----------

## pa4wdh

I just hit the openvpn issue and sovled it by remerging it, thanks for the info. I was about to make a symlink from /sbin/ifconfig to /bin/ifconfig but so far the only problem was openvpn   :Smile: 

But isn't this something which is news-worthy ? Every *nix-like system i've run in to for the last 15 years had /sbin/ifconfig and not /bin/ifconfig, i guess there are tons scripts with a hardcoded /sbin/ifconfig out there. I guess it would be nice to be notified of such a change. And by the way: The output changed too, if you don't like it set the "old-output" useflag on sys-apps/net-tools  :Very Happy: 

----------

## miket

I noticed the move of ifconfig some time ago.  My response to that was "hot damn!  I don't have to type /sbin/ifconfig any more.  This is great!"

I run ifconfig enough that typing /sbin/ifconfig was annoying but not enough for me to bother making an alias for it.

Now we can wait a year or so for this convenience to show up in Debian :)

----------

## rz70

I agree with you...

For example "Juniper VPN client" has /sbin/ifconfig hardcoded in its .so library. 

And many more application may be affected by this "move".

I would appreciate at least some notification after emerging sys-apps/net-tools.

 *pa4wdh wrote:*   

> I just hit the openvpn issue and sovled it by remerging it, thanks for the info. I was about to make a symlink from /sbin/ifconfig to /bin/ifconfig but so far the only problem was openvpn  
> 
> But isn't this something which is news-worthy ? Every *nix-like system i've run in to for the last 15 years had /sbin/ifconfig and not /bin/ifconfig, i guess there are tons scripts with a hardcoded /sbin/ifconfig out there. I guess it would be nice to be notified of such a change. And by the way: The output changed too, if you don't like it set the "old-output" useflag on sys-apps/net-tools 

 

----------

