0

This is a continuation of my other thread.

I need to not have to type in ifup eth0 every time i boot to get an IP-address to access the internet. I've tried making a cronjob crontab -e:

@reboot ifup eth0

But it seems the cronjob is not even running even though if i edit it to run the command every minute.

I've also tried creating a init.d script (and made it executable with chmod 755) to run the command in /etc/init.d/ folder and made a symlink to the runlevel folder I'm running in.

Still, no internet access and no ip-address till i manually enter the command.

I also found out restarting the service with /etc/init.d/networking restart also does the trick.

In the /etc/networking/interfaces file, I have the usual:

...
auto eth0
iface eth0 inet dhcp
...

If i set a static IP address, i obviously have an IP-address as after booting, but ping google.com returns "bad address".

So these are my questions:

  1. Why isn't my init script working?
  2. Why isn't my cronjob working?
  3. Why do even need to run the command in the first place, as the etc/init.d/networking is running the ifup -acommand?

I don't really care how i get internet access at boot time right now, i just need it to work. No matter what solution i come upon, does absolutly nothing. Everything is run as root, so it can't be anything about permissions.

Varyag
  • 676
  • 12
  • 29
  • Do you use systemd or sysvinit as init? – Nayfe Sep 30 '19 at 15:46
  • check whether this config is deployed: https://github.com/madisongh/meta-tegra/blob/master/recipes-core/systemd/systemd-conf/tegra/wired.network – Oleksandr Kravchuk Sep 30 '19 at 17:30
  • I was pretty sure i was running systemd but i can see i didn't even add it (or any other init sytem) to DISTRO_FEATURES_append... so what init system am i running if i didn't specify anything? `ps -eaf` only shows init[5] as PID #1 - meanwhile I'm gonna create a new image with systemd in DISTRO_FEATURES_append and see if I can get it to work – Varyag Oct 01 '19 at 06:25
  • You can check which init you use with `ls -l /sbin/init` on running machine, or in Yocto with `bitbake -e | grep ^VIRTUAL-RUNTIME_init_manager` – Nayfe Oct 01 '19 at 13:12
  • Ty @Nayfe. I'm using sysvinit in the system i have right now, i guess it is the default init. I am making a systemd image now however, as i am more experienced with that and because there is apperently some conf bb files from meta-tegra layer. I'll return once i boot up the new image and test internet connection. – Varyag Oct 01 '19 at 13:22

0 Answers0