Hi,
I'm running 8beta3 and in order to start eth0 with a static IP I did the following:
- Edited bootlocal.sh to start a script called eth0.sh
- eth0.sh contained this:
#!/bin/sh
pkill udhcpc
ifconfig eth0 192.168.0.254 netmask 255.255.255.0 broadcast 192.168.0.255 up
route add default gw 192.168.0.1
echo nameserver 192.168.0.17 >> /etc/resolv.conf
- I then made eth0.sh executable
- Backed up and rebooted.
This worked as expected for several weeks but this morning after installing a package and backing up, the eth0 script was no longer able to set the static IP address. I then noticed that udhcpc was still running while it should have been killed by the script. Perhaps something changed in the boot order or timing and udhcpc is not up by the time the script tries to kill it?
Anyway, I decided to proceed differently and added nodhcp to cmdline.txt and removed pkill udhcpc from my script but this didn't seem to prevent the dhcp service from starting and I still couldn't set the static IP address unless I manually ran my script.
Some my questions are:
- Why can't my script kill the dhcp service anymore?
- What is the correct way of disabling dhcp and setting a static address?
Thanks!