Re: [gentoo-user] Ifplugd breaks services

2014-06-18 Thread thegeezer
On 06/17/2014 10:59 PM, Mick wrote:
 I can't recall ever having heard a beep when the cable is
 disconnected. :-/ 

odd.  i wish i knew with certainty where ifplug hooks in.

if you
# ps aux | grep ifplug

do you have a -b on the line? such as   /usr/sbin/ifplugd -b --iface=eth0
that's how you disable the beep, -b = nobeep



Re: [gentoo-user] Ifplugd breaks services

2014-06-18 Thread Mick
On Wednesday 18 Jun 2014 14:03:47 thegeezer wrote:
 On 06/17/2014 10:59 PM, Mick wrote:
  I can't recall ever having heard a beep when the cable is
  disconnected. :-/
 
 odd.  i wish i knew with certainty where ifplug hooks in.
 
 if you
 # ps aux | grep ifplug
 
 do you have a -b on the line? such as   /usr/sbin/ifplugd -b --iface=eth0
 that's how you disable the beep, -b = nobeep

No, this is what it shows:

/usr/sbin/ifplugd --iface=enp11s0
-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Ifplugd breaks services

2014-06-17 Thread thegeezer
On 06/14/2014 11:24 PM, Mick wrote:
 On Tuesday 10 Jun 2014 11:43:31 thegeezer wrote:
 I used to really like ifplugd.  mostly for the audible beep when things
 are disconnected as it's easier to diagnose from afar.
 What audible beep?  Am I missing some obscure configuration variable on my 
 systems?

lol yes
http://www.gentoo-wiki.info/Ifplugd
but mysteriously i don't have /etc/conf.d/ifplugd -- my
/etc/ifplugd/ifplugd.actions is below and is the only ifplugd file i can
find

it could be you are missing pcspeaker kernel module ?   pcspkr





# /etc/ifplugd/ifplugd.actions
if grep -q initng /proc/1/cmdline
then
EXEC=/sbin/ngc
INITNG=yes
else
EXEC=/etc/init.d/net.$1
INITNG=no
fi

case $2 in
up)
if [ ${INITNG} = yes ]
then
ARGS=-u net/$1
else
ARGS=--quiet start
fi
;;
down)
if [ ${INITNG} = yes ]
then
ARGS=-d net/$1
else
ARGS=--quiet stop
fi
;;
*)
echo $0: wrong arguments 2
echo Call with interface up|down 2
exit 1
;;
esac

export IN_BACKGROUND=true

if [ -x ${EXEC} ]
then
${EXEC} ${ARGS}
exit 0
else
logger -t ifplugd.act
exit 1
fi




Re: [gentoo-user] Ifplugd breaks services

2014-06-17 Thread Mick
On Tuesday 17 Jun 2014 22:08:11 thegeezer wrote:
 On 06/14/2014 11:24 PM, Mick wrote:
  On Tuesday 10 Jun 2014 11:43:31 thegeezer wrote:
  I used to really like ifplugd.  mostly for the audible beep when things
  are disconnected as it's easier to diagnose from afar.
  
  What audible beep?  Am I missing some obscure configuration variable on
  my systems?
 
 lol yes
 http://www.gentoo-wiki.info/Ifplugd
 but mysteriously i don't have /etc/conf.d/ifplugd -- my
 /etc/ifplugd/ifplugd.actions is below and is the only ifplugd file i can
 find
 
 it could be you are missing pcspeaker kernel module ?   pcspkr
 
 
 
 
 
 # /etc/ifplugd/ifplugd.actions
 if grep -q initng /proc/1/cmdline
 then
 EXEC=/sbin/ngc
 INITNG=yes
 else
 EXEC=/etc/init.d/net.$1
 INITNG=no
 fi
 
 case $2 in
 up)
 if [ ${INITNG} = yes ]
 then
 ARGS=-u net/$1
 else
 ARGS=--quiet start
 fi
 ;;
 down)
 if [ ${INITNG} = yes ]
 then
 ARGS=-d net/$1
 else
 ARGS=--quiet stop
 fi
 ;;
 *)
 echo $0: wrong arguments 2
 echo Call with interface up|down 2
 exit 1
 ;;
 esac
 
 export IN_BACKGROUND=true
 
 if [ -x ${EXEC} ]
 then
 ${EXEC} ${ARGS}
 exit 0
 else
 logger -t ifplugd.act
 exit 1
 fi


My ifpugd.actions looks the same.

I have PCSPKR built in my kernel:

$ grep -i pcspkr /usr/src/linux/.config
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_PCSPKR_PLATFORM=y
CONFIG_INPUT_PCSPKR=y

I can't recall ever having heard a beep when the cable is disconnected.  :-/

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Ifplugd breaks services

2014-06-15 Thread Matti Nykyri
 On Jun 8, 2014, at 21:19, Neil Bothwick n...@digimed.co.uk wrote:

 
 On Sun, 8 Jun 2014 20:44:47 +0300, Matti Nykyri wrote:
 
 Have you tried changing rc_depend_strict in /etc/rc.conf?  
 
 Setting rc_depend_strict to NO, fixes the problem :) With that set to
 YES all the services are killed. So I'll stick with NO. Still I think
 that all services stopped should be restarted by default.
 
 Yes, it does seem like a bug, or at least an undocumented feature.

Actually found the true reason for the services not starting. When you stop 
samba it fails to terminate 2 instances of nbmd. So when you try to start samba 
it fails. But it will start normally on the second go. Both of these failures 
will fall within samba or openrc.

 flamebaitOr you could switch to systemd which I suspect could be
 made to handle this situation better./flamebait :)  
 
 I rather not ;)
 
 You're already using some Lennartware so you're already on the slippery
 slope :-O



Re: [gentoo-user] Ifplugd breaks services

2014-06-14 Thread Mick
On Tuesday 10 Jun 2014 11:43:31 thegeezer wrote:
 I used to really like ifplugd.  mostly for the audible beep when things
 are disconnected as it's easier to diagnose from afar.

What audible beep?  Am I missing some obscure configuration variable on my 
systems?

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Ifplugd breaks services

2014-06-10 Thread thegeezer
On 06/08/2014 10:25 AM, Matti Nykyri wrote:
 Hi

 I also have other problems in my life. One of them is on one of my gentoo 
 server. This server has two network cards one serves intranet and the other 
 internet. The on that is on the internet is attached to a cable modem. The 
 modem is buggy and some times reboots it self losing the link so I have 
 ifplugd there get new address via dhcp immediately. Intranet card is 
 configured not to use ifplugd. I'm using OpenRC.

 The problems are related to iptables and samba.

 Samba: when ifplugd runs down the internet card samba is killed. This 
 shouldn't happen. Samba is configured only to use intranet card. Samba always 
 fails to start when ifplugd starts the internet card. Manual starting is 
 required.

 Iptables: the system uses new nic names (enp7s0 etc). Iptables has them 
 correctly in the rules and in rules save. However when ifplugd cycles the 
 internet nic all the nic names in the in-kernel rules change to eth0 an eth1. 
 I need to zap iptables and then start it to reset the rules. 

 Any suggestions where to start? Or just disable ifplugd?

 --
 Matti
I used to really like ifplugd.  mostly for the audible beep when things
are disconnected as it's easier to diagnose from afar.
being able to up/down interfaces based on connection state was also
great for dynamic routing when combined with openrc/netifrc
however, lack of clear config, no way to at runtime remove it from an
interface and just complete confusion over software based interfaces
i.e. gre tunnels or even macvlans all mean it is slowly being
removed from my boxen.




[gentoo-user] Ifplugd breaks services

2014-06-08 Thread Matti Nykyri
Hi

I also have other problems in my life. One of them is on one of my gentoo 
server. This server has two network cards one serves intranet and the other 
internet. The on that is on the internet is attached to a cable modem. The 
modem is buggy and some times reboots it self losing the link so I have ifplugd 
there get new address via dhcp immediately. Intranet card is configured not to 
use ifplugd. I'm using OpenRC.

The problems are related to iptables and samba.

Samba: when ifplugd runs down the internet card samba is killed. This shouldn't 
happen. Samba is configured only to use intranet card. Samba always fails to 
start when ifplugd starts the internet card. Manual starting is required.

Iptables: the system uses new nic names (enp7s0 etc). Iptables has them 
correctly in the rules and in rules save. However when ifplugd cycles the 
internet nic all the nic names in the in-kernel rules change to eth0 an eth1. I 
need to zap iptables and then start it to reset the rules. 

Any suggestions where to start? Or just disable ifplugd?

--
Matti


Re: [gentoo-user] Ifplugd breaks services

2014-06-08 Thread Mick
On Sunday 08 Jun 2014 10:25:40 Matti Nykyri wrote:
 Hi
 
 I also have other problems in my life. One of them is on one of my gentoo
 server. This server has two network cards one serves intranet and the
 other internet. The on that is on the internet is attached to a cable
 modem. The modem is buggy and some times reboots it self losing the link
 so I have ifplugd there get new address via dhcp immediately. Intranet
 card is configured not to use ifplugd. I'm using OpenRC.

Are you sure of this?  How have you configured your intranet card to not be 
acted upon by ifplugd?  From what I see, ifplugd will pick up any interface in 
/etc/init.d:

  EXEC=/etc/init.d/net.$1


 The problems are related to iptables and samba.
 
 Samba: when ifplugd runs down the internet card samba is killed. This
 shouldn't happen. Samba is configured only to use intranet card. Samba
 always fails to start when ifplugd starts the internet card. Manual
 starting is required.
 
 Iptables: the system uses new nic names (enp7s0 etc). Iptables has them
 correctly in the rules and in rules save. However when ifplugd cycles the
 internet nic all the nic names in the in-kernel rules change to eth0 an
 eth1. I need to zap iptables and then start it to reset the rules.

This does not happen here.  When ifplugd restarts a NIC it always comes back 
with the new consistent naming.  Do you have some udev rules defined which are 
picked up on the second time that the ifplugd brings up the card, but not the 
first?


 Any suggestions where to start? Or just disable ifplugd?

Have you tried configuring static IP addresses, broadcast and gateways for 
each card using the /etc/cong.d/net file?  You can still set dhcp as a fall 
back if you want, although I am not sure it is necessary for a server in a 
static LAN.

The file /usr/share/doc/netifrc-0.2.2/net.example.bz2 provides suggestions for 
different set ups.

-- 
Regards,
Mick


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Ifplugd breaks services

2014-06-08 Thread Matti Nykyri
On Sun, Jun 08, 2014 at 11:25:53AM +0100, Mick wrote:
 On Sunday 08 Jun 2014 10:25:40 Matti Nykyri wrote:
  Hi
  
  I also have other problems in my life. One of them is on one of my gentoo
  server. This server has two network cards one serves intranet and the
  other internet. The on that is on the internet is attached to a cable
  modem. The modem is buggy and some times reboots it self losing the link
  so I have ifplugd there get new address via dhcp immediately. Intranet
  card is configured not to use ifplugd. I'm using OpenRC.
 
 Are you sure of this?  How have you configured your intranet card to not be 
 acted upon by ifplugd?  From what I see, ifplugd will pick up any interface 
 in 
 /etc/init.d:
 
   EXEC=/etc/init.d/net.$1

Actually it's not ifplugd's fault. It is just the one that restarts services... 
The restarting is the thing that breaks stuff:



server% [13:44] /var/log$ sudo iptables -v -L -t nat
Chain POSTROUTING (policy ACCEPT 10142 packets, 743K bytes)
 pkts bytes target prot opt in out source   destination 

 8307  616K MASQUERADE  all  --  anyenp0s10  anywhere anywhere  
  
server% [13:45] /var/log$ sudo /etc/init.d/net.enp0s10 stop
 * Stopping NIS Server ...   [ ok ]
 * samba - stop: smbd ...   [ ok ]
 * samba - stop: nmbd ...
 * start-stop-daemon: 2 process(es) refused to stop  [ !! ]
 * Unmounting network filesystems ...[ ok ]
 * Stopping chrooted named ...
 * Umounting chroot dirs ...
 * umounting /chroot/dns/usr/share/GeoIP ... [ ok ]
 * umounting /chroot/dns/etc/bind ...[ ok ]
 * umounting /chroot/dns/var/log/named ...   [ ok ]
 * umounting /chroot/dns/var/bind ...[ ok ]
 * Stopping dhcpd ...[ ok ]
 * Bringing down interface enp0s10
 *   Stopping dhclient on enp0s10 ...[ ok ]
 *   Stopping ifplugd on enp0s10 ... [ ok ]
server% [13:45] /var/log$ sudo iptables -v -L -t nat
Chain POSTROUTING (policy ACCEPT 10147 packets, 743K bytes)
 pkts bytes target prot opt in out source   destination 

 8309  617K MASQUERADE  all  --  anyenp0s10  anywhere anywhere  
  
server% [13:45] /var/log$ sudo /etc/init.d/net.enp0s10 start
 * Bringing up interface enp0s10
 *   Changing MAC address of enp0s10 ... [ ok ]
 * changed to 00:80:23:7A:8A:A4
 *   Starting ifplugd on enp0s10 ... [ ok ]
 * Backgrounding ...
 * WARNING: net.enp0s10 has started, but is inactive
server% [13:45] /var/log$ sudo iptables -v -L -t nat
Chain POSTROUTING (policy ACCEPT 10147 packets, 743K bytes)
 pkts bytes target prot opt in out source   destination 

 8309  617K MASQUERADE  all  --  anyenp0s10  anywhere anywhere  
  


It takes around 40 seconds for dhclient to address from ISP 
(net-misc/dhcp-4.2.5_p1)
After it gets the address iptables is changed:


server% [13:45] /var/log$ sudo iptables -v -L -t nat
Chain POSTROUTING (policy ACCEPT 2 packets, 152 bytes)
 pkts bytes target prot opt in out source   destination 

0 0 MASQUERADE  all  --  anyeth1anywhere anywhere   
 
server% [13:48] /var/log$ ps aux | grep dhclient  
root 22011  0.0  0.2  16200  7108 ?Ss   13:46   0:00 /sbin/dhclient 
-e PEER_NTP=no -e IF_METRIC=3 -q -1 -pf /var/run/dhclient-enp0s10.pid enp0s10
server% [13:48] /var/log$ ls /etc/init.d/net*
lrwxrwxrwx 1 root root 6 Oct  4  2011 /etc/init.d/net.enp0s10 - net.lo*
lrwxrwxrwx 1 root root 6 Oct  4  2011 /etc/init.d/net.enp5s12 - net.lo*
-rwxr-xr-x 1 root root 17412 Jan  2 23:42 /etc/init.d/net.lo*



  The problems are related to iptables and samba.
  
  Samba: when ifplugd runs down the internet card samba is killed. This
  shouldn't happen. Samba is configured only to use intranet card. Samba
  always fails to start when ifplugd starts the internet card. Manual
  starting is required.
  
  Iptables: the system uses new nic names (enp7s0 etc). Iptables has them
  correctly in the rules and in rules save. However when ifplugd cycles the
  internet nic all the nic names in the in-kernel rules change to eth0 an
  eth1. I need to zap iptables and then start it to reset the rules.
 
 This does not happen here.  When ifplugd restarts a NIC it always comes back 
 with the new consistent naming.  Do you have some udev rules defined which 
 are 
 picked up on the second time that the ifplugd brings up the card, but not the 
 first?

No I don't. And as stated when dhclient sets 

Re: [gentoo-user] Ifplugd breaks services

2014-06-08 Thread Neil Bothwick
On Sun, 8 Jun 2014 15:01:02 +0300, Matti Nykyri wrote:

 Actually it's not ifplugd's fault. It is just the one that restarts
 services... The restarting is the thing that breaks stuff:

Are you running ifplugd directly or letting openrc deal with this? The
latter is the recommended way for openrc, leave ifplugd installed but
don't add it to a runlevel. Does the problem persist if you do this?

Have you tried changing rc_depend_strict in /etc/rc.conf?

flamebaitOr you could switch to systemd which I suspect could be made
to handle this situation better./flamebait :)


-- 
Neil Bothwick

I work with User-Surly Software.


signature.asc
Description: PGP signature


Re: [gentoo-user] Ifplugd breaks services

2014-06-08 Thread Matti Nykyri
 On Jun 8, 2014, at 19:15, Neil Bothwick n...@digimed.co.uk wrote:
 
 On Sun, 8 Jun 2014 15:01:02 +0300, Matti Nykyri wrote:
 
 Actually it's not ifplugd's fault. It is just the one that restarts
 services... The restarting is the thing that breaks stuff:
 
 Are you running ifplugd directly or letting openrc deal with this? The
 latter is the recommended way for openrc, leave ifplugd installed but
 don't add it to a runlevel. Does the problem persist if you do this?

Ifplugd package doesn't have anything installed in init.d/ so it's not added to 
any runlevel.

 
 Have you tried changing rc_depend_strict in /etc/rc.conf?

Setting rc_depend_strict to NO, fixes the problem :) With that set to YES all 
the services are killed. So I'll stick with NO. Still I think that all services 
stopped should be restarted by default.

 flamebaitOr you could switch to systemd which I suspect could be made
 to handle this situation better./flamebait :)

I rather not ;) 

-- 
-Matti


Re: [gentoo-user] Ifplugd breaks services

2014-06-08 Thread Neil Bothwick
On Sun, 8 Jun 2014 20:44:47 +0300, Matti Nykyri wrote:

  Have you tried changing rc_depend_strict in /etc/rc.conf?  
 
 Setting rc_depend_strict to NO, fixes the problem :) With that set to
 YES all the services are killed. So I'll stick with NO. Still I think
 that all services stopped should be restarted by default.

Yes, it does seem like a bug, or at least an undocumented feature.
 
  flamebaitOr you could switch to systemd which I suspect could be
  made to handle this situation better./flamebait :)  
 
 I rather not ;) 

You're already using some Lennartware so you're already on the slippery
slope :-O


-- 
Neil Bothwick

WinErr 678: This will end your Windows session. Do you want to play
another game?


signature.asc
Description: PGP signature