Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/sbin/ifconfig or /bin/ifconfig?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
shallpion
Guru
Guru


Joined: 29 Sep 2008
Posts: 331

PostPosted: Tue Jul 03, 2012 7:03 pm    Post subject: /sbin/ifconfig or /bin/ifconfig? Reply with quote

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.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Jul 03, 2012 10:10 pm    Post subject: Re: /sbin/ifconfig or /bin/ifconfig? Reply with quote

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
Back to top
View user's profile Send private message
shallpion
Guru
Guru


Joined: 29 Sep 2008
Posts: 331

PostPosted: Tue Jul 03, 2012 10:16 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Jul 03, 2012 11:02 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
shallpion
Guru
Guru


Joined: 29 Sep 2008
Posts: 331

PostPosted: Tue Jul 03, 2012 11:04 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
bell
Guru
Guru


Joined: 27 Nov 2007
Posts: 508

PostPosted: Sun Nov 25, 2012 7:24 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
olivier-lonzi
n00b
n00b


Joined: 25 Nov 2012
Posts: 2

PostPosted: Sun Nov 25, 2012 11:04 am    Post subject: Reply with quote

For my part, I have the problem with openvpn !

Just do : emerge -av openvpn !

And that's work :)


Try to re-emerge openrc and iptables !

Best Regards,
Oliver.
Back to top
View user's profile Send private message
Yuu
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 223
Location: France

PostPosted: Sun Nov 25, 2012 8:42 pm    Post subject: Reply with quote

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
Sun Nov 25 21:38:17 2012 /etc/openvpn/up.sh tun0 1442 1500 14.32.90.24 255.255.255.192 init

_________________
Main laptop : T8300 cpu | 200 GB hard drive | 2 GB of ram | 8600M GT | Gentoo x86_64
Server : Celeron 220 cpu | 250 GB hard drive | 2 GB of ram | SiS 662 VGA | Gentoo x86_64
Back to top
View user's profile Send private message
olivier-lonzi
n00b
n00b


Joined: 25 Nov 2012
Posts: 2

PostPosted: Sun Nov 25, 2012 8:51 pm    Post subject: Reply with quote

ok perfect :)

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

Do not forget to pass your Thread in Resolved !
Back to top
View user's profile Send private message
Yuu
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 223
Location: France

PostPosted: Sun Nov 25, 2012 9:44 pm    Post subject: Reply with quote

@olivier-lonzi : I just re-emerged openvpn.
Code:
# emerge -v1 net-misc/openvpn


It worked fine on my two Gentoo boxes :)

I hope that this nice solution will solve shallpion's problem too.
_________________
Main laptop : T8300 cpu | 200 GB hard drive | 2 GB of ram | 8600M GT | Gentoo x86_64
Server : Celeron 220 cpu | 250 GB hard drive | 2 GB of ram | SiS 662 VGA | Gentoo x86_64
Back to top
View user's profile Send private message
jamapii
l33t
l33t


Joined: 16 Sep 2004
Posts: 637

PostPosted: Mon Nov 26, 2012 11:36 am    Post subject: Reply with quote

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:
Code:
#!/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.
Back to top
View user's profile Send private message
CMoH
n00b
n00b


Joined: 08 Sep 2004
Posts: 27
Location: Timisoara, Romania

PostPosted: Mon Nov 26, 2012 5:43 pm    Post subject: Reply with quote

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

Code:
#!/bin/sh
/bin/ifconfig $@
Back to top
View user's profile Send private message
faemin
n00b
n00b


Joined: 16 Oct 2012
Posts: 22

PostPosted: Sun Dec 02, 2012 5:07 am    Post subject: Re: /sbin/ifconfig or /bin/ifconfig? Reply with quote

...

Last edited by faemin on Sun Dec 02, 2012 9:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Sun Dec 02, 2012 8:30 am    Post subject: Re: /sbin/ifconfig or /bin/ifconfig? Reply with quote

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.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21490

PostPosted: Sun Dec 02, 2012 5:58 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2052
Location: San Jose, CA

PostPosted: Wed Dec 05, 2012 9:23 pm    Post subject: Reply with quote

Thanks for this thread, you saved me lots of time...
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 806

PostPosted: Sat Dec 15, 2012 1:54 pm    Post subject: Reply with quote

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 :D
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
miket
Guru
Guru


Joined: 28 Apr 2007
Posts: 483
Location: Gainesville, FL, USA

PostPosted: Mon Dec 17, 2012 5:17 am    Post subject: Reply with quote

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 :)
Back to top
View user's profile Send private message
rz70
n00b
n00b


Joined: 11 Feb 2013
Posts: 1

PostPosted: Mon Feb 11, 2013 9:18 pm    Post subject: Reply with quote

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 :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum