Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] ifplugd launched from /etc/local.d stops after some seconds (Read 368 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

[SOLVED] ifplugd launched from /etc/local.d stops after some seconds

I created a script in /etc/local.d that starts busybox ifplugd.
ifplugd is started at boot but after some seconds it stops.
If i run the script from command line it works like it is expected.
There is something i'm missing?

Thanks

Re: ifplugd launched from /etc/local.d stops after some seconds

Reply #1
Without a log of some sorts you won't see what is going on, so that is necessary, however first thing for you to try is to introduce a delay in the script, sleep 5 or something, maybe the drivers for the network aren't loaded yet.

Re: ifplugd launched from /etc/local.d stops after some seconds

Reply #2
Without a log of some sorts you won't see what is going on, so that is necessary, however first thing for you to try is to introduce a delay in the script, sleep 5 or something, maybe the drivers for the network aren't loaded yet.

Already done....
this is the script i adapted from the busybox source

Code: [Select]
#!/bin/bash
sleep 10
if="eth0"
if [[ ! -z `find /sys/class/net -name "$if"` ]]; then
if [ -f "/etc/network/interfaces" ]; then
/usr/bin/ifup -a
else
ip link set eth0 up
logger "Starting ifplugd on $if"
exec \
env - PATH="$PATH" \
/usr/bin/busybox softlimit \
/usr/bin/busybox setuidgid root \
/usr/bin/ifplugd -aqlMns -t3 -u8 -d8 -i "$if" -r "/etc/network/ifplugd_handler"
fi
fi

i will try to remove the ns flag from the command to see if ifplugd inserts some log.

Re: ifplugd launched from /etc/local.d stops after some seconds

Reply #3
Solved...
i removed
Code: [Select]
		exec \
env - PATH="$PATH" \
/usr/bin/busybox softlimit \
/usr/bin/busybox setuidgid root \

from the script and now it works like expected...
i assumed that all that stuff was necessary, but i considered its meaning and  i decided to cut it off, and this worked :)

anyway no log from ifplugd, also removing the s option ;)

 

Re: ifplugd launched from /etc/local.d stops after some seconds

Reply #4
Oh, and I was about to say that more of that script was unnecessary and could've caused more conflicts, like also the ifup/ip link parts, but glad you solved it.