Sysupgrade aborted with return code 256?

#1

Some system information first:

  • base firmware version: 18.06.2
  • architecture: ramips and mips (this happens on both)

So sometimes when I run sysupgrade -n s_upgrade.bin, my router just shuts off. So I opened up a terminal via serial and found this:

Sending KILL to remaining processes ... hostapd hostapd hostapd hostapd
hostapd hostapd hostapd hostapd hostapd hostapd
Failed to kill a[ 125.891451] reboot: Restarting system
ll processes.
sysupgrade aborted with return code: 256

Everything I've read about other people having this issue say to upgrade the firmware (tried that), or kill the process that is causing sysupgrade to give this error, but it's a different process almost every time. Is there anything else I could try to fix this? It's really annoying more than anything since it doesn't actually break anything, you can just turn it back on and try again and it usually works.

Any insight will be helpful, or just let me know if more information would be helpful to you.

Thanks!

1 Like
#2

Try wifi down and killall -9 hostapd before invoking sysupgrade, there has been an issue with sysupgrade killing off hostapd in the past.

#3

Thanks for the reply! At the moment I’m not running a build of OpenWrt with any wireless drivers and so hostapd isn’t running on the system. When digging into this a bit I did run across that WiFi might cause an issue on the issue tracker or on a mailing list. In trying to isolate what the problem could be I’m running a build without any WiFi. I will look more in the morning to see if I can jog my memory on which process caused the issue more than once.

#4

Will there be an official patch ?
Asking, because I also had issues regarding sysupgrade not doing anything, blaming open swapfile to be the reason, but, may be I was wrong.

#5

Some more testing today and the two processes I have seen cause sysupgrade to fail more than once are ntpd and odhcpd. Can I just run killall -9 ntpd and killall -9 odhcpd before sysupgrades to prevent that?

EDIT: mount_root is another process that I have seen causes this problem

#6

Yes, that shouldn't cause any issues.

#7

So when I run killall -9 ntpd and killall -9 odhcpd the processes just restart themselves. I suspect there's some underlying mechanism that restarts them that I also need to stop?
I'm also trying to do this programmatically in C to run sysupgrade, but when I run this, ntpd and odhcpd restart and then the C app hangs so sysupgrade doesn't execute.

char *kill_ntpd[] = { "/usr/bin/killall", "ntpd", NULL };
char *kill_odhcpd[] = { "/usr/bin/killall", "odhcpd", NULL };
execv(kill_ntpd[0], kill_nptd);
execv(kill_odhcpd[0], kill_odhcpd); 

Any ideas?

#8

I suspect, procd does the auto restart.

To verify this, you might try
/etc/init.d/ntpd disable
killall -9 ntpd

1 Like
#9

Hmm I couldn't get that to work for ntpd; the process still restarted. I checked and ntpd isn't in the init.d directory, so maybe something else is starting it?

However, the disable for odhcpd seemed to work.

Edited my post above, but I also see this happening with mount_root. Would running /etc/init.d/umount disable disable mount_root from restarting? (and not cause any detrimental effects)

Thanks!