Artix Linux Forum

Init systems => dinit => Topic started by: purpleleaf on 28 June 2023, 22:34:02

Title: [SOLVED] ifplugd launched from /etc/local.d stops after some seconds
Post by: purpleleaf on 28 June 2023, 22:34:02
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
Title: Re: ifplugd launched from /etc/local.d stops after some seconds
Post by: Hitman on 28 June 2023, 22:36:25
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.
Title: Re: ifplugd launched from /etc/local.d stops after some seconds
Post by: purpleleaf on 28 June 2023, 22:54:31
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.
Title: Re: ifplugd launched from /etc/local.d stops after some seconds
Post by: purpleleaf on 28 June 2023, 23:24:51
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 ;)
Title: Re: ifplugd launched from /etc/local.d stops after some seconds
Post by: Hitman on 29 June 2023, 00:47:26
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.