Jump to content

SSH doesn't work on Orange Pi Zero


GeorgeL

Recommended Posts

Hi, I setup armbian version 5.6 (Ubuntu 16.04.5 Xenial) on OrangePI PC. Working long time without problem. But after power failure I found that directories in /var/run have bad permissions and some daemons won't start. After investigation I found failure start of systemd-tmpfiles:

 

systemd-tmpfiles[210]: Failed to fstat() file /dev/btrfs-control: Bad file descriptor
systemd-tmpfiles[210]: Failed to fstat() file /dev/net: Bad file descriptor
systemd-tmpfiles[210]: Failed to fstat() file /dev/net/tun: Bad file descriptor

I setup debug loglevel and got this:

systemd-tmpfiles[210]: Failed to fstat() file /dev/btrfs-control: Bad file descriptor
systemd-tmpfiles[210]: Running create action for entry d /dev/net
systemd-tmpfiles[210]: Created directory "/dev/net".
systemd-tmpfiles[210]: Failed to fstat() file /dev/net: Bad file descriptor
systemd-tmpfiles[210]: Running create action for entry c /dev/net/tun
systemd-tmpfiles[210]: Created char device node "/dev/net/tun" 1:128.
systemd-tmpfiles[210]: Failed to fstat() file /dev/net/tun: Bad file descriptor

Corrupted filesystem? I created /forcefsck and reboot. But /dev directory is not on root filesystem and is dynamicaly created.

 

I apologize for my English, Thanks.

Link to comment
Share on other sites

Hi,

I have two orange pi zero devices. But I can't log in via putty to both devices. There is connection refused error. Syslog contains this line:

Nov 21 09:15:43 localhost sshd[996]: Missing privilege separation directory: /var/run/sshd

 

But if I create this dir manually, ssh starts fine.. until next boot.

 

I suppose it happens because 'systemd-tmpfiles-setup' service start failed at system boot:

[FAILED] Failed to start Create Volatile Files and Directories.
See 'systemctl status systemd-tmpfiles-setup.service' for details.

 

Also before this message the boot log contains these lines:

..

[FAILED] Failed to start Load Kernel Modules.
See 'systemctl status systemd-modules-load.service' for details.

..
[FAILED] Failed to start Create Static Device Nodes in /dev.
See 'systemctl status systemd-tmpfiles-setup-dev.service' for details.

..

 

The first device has ARMBIAN 5.60 stable Ubuntu 16.04.5 LTS 3.4.113-sun8i, the second - ARMBIAN 5.35 user-built Ubuntu 16.04.3 LTS 3.4.113-sun8i

 

How to fix it?

Link to comment
Share on other sites

1. h2tesw test finished without errors.

2. I wrote Armbian 5.35 image. Change root pswd, reboot. SSH is ok.

3. Then unattended upgrades are run. After upgrading the OS has 5.60 ver. Reboot. And now SSH service start failed at system boot. I can't log in via putty.

Why so?

Link to comment
Share on other sites

Similarly, on Orange Pi One and CubieTruck. The sshd cannot find the /var/run/sshd folder, it simply does not exist. After creating the folder and starting the service, everything works until the reboot. And after a reboot, the same thing again: sshd cannot find the /var/run/sshd folder... Orange Pi One works on uSD card, but CubieTruck works on SATA SSD.

Edited by AlexTochka
Link to comment
Share on other sites

4 hours ago, AlexTochka said:

from another device - CubieTruck.


And again Ubuntu Xenial which could and is most likely broken upstream. We can't do anything about that.

Link to comment
Share on other sites

I found issue trigger. After this upgrade:

Packages that will be upgraded: libnss-myhostname libpam-systemd libpython2.7-minimal libpython2.7-stdlib libpython3.5 libpython3.5-minimal libpython3.5-stdlib libsystemd0 libudev1 linux-libc-dev python2.7 python2.7-minimal python3.5 python3.5-minimal systemd systemd-sysv udev

 

the 'systemd-tmpfiles-setup' service start failed at system boot.

Link to comment
Share on other sites

  • Igor pinned this topic

I builded image with legacy kernel and Xenial desktop using armbian build tools (5.67).  I get following boot log:

Spoiler
Quote

U-Boot SPL 2018.05-armbian (Nov 21 2018 - 11:13:04 +0500)
DRAM: 256 MiB
Trying to boot from MMC1


U-Boot 2018.05-armbian (Nov 21 2018 - 11:13:04 +0500) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: FriendlyARM NanoPi DUO Air
DRAM:  256 MiB
MMC:   SUNXI SD/MMC: 0
Loading Environment from EXT4... ** File not found /boot/boot.env **

** Unable to read "/boot/boot.env" from mmc0:1 **
Failed (-5)
In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
230454 bytes read in 31 ms (7.1 MiB/s)
Unknown command 'bmp' - try 'help'
starting USB...
No controllers found
Autoboot in 1 seconds, press <Space> to stop
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
3684 bytes read in 10 ms (359.4 KiB/s)
## Executing script at 43100000
U-boot loaded from SD
Boot script loaded from mmc
142 bytes read in 8 ms (16.6 KiB/s)
** File not found /boot/uInitrd **
4654472 bytes read in 371 ms (12 MiB/s)
Found legacy kernel configuration
35384 bytes read in 24 ms (1.4 MiB/s)
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
SCRIPT FAILED: continuing...
starting USB...
No controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No controllers found
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-sunxi
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
starting USB...
No controllers found
No ethernet found.

 

 

 

Environments and mmc/boot folder consist of:

Spoiler
Quote

=> ls mmc 0:1 /boot
<DIR>       4096 .
<DIR>       4096 ..
<SYM>         17 script.bin
<SYM>         21 zImage
<DIR>       4096 bin
<DIR>       4096 overlay-user
            1536 armbian_first_run.txt.template
         2043391 System.map-3.4.113-sun8i
             142 armbianEnv.txt
           97193 config-3.4.113-sun8i
            4882 boot-desktop.png
          230454 boot.bmp
            3612 boot.cmd
            3684 boot.scr
         5220352 initrd.img-3.4.113-sun8i
         4654472 vmlinuz-3.4.113-sun8i
         5220288 initrd.img-3.4.113-sun8i.dpkg-bak
=> printenv
arch=arm
baudrate=115200
board=sunxi
board_name=sunxi
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=fel mmc0 usb0 pxe dhcp
bootargs=root=UUID=ed18df55-26a6-4886-97bb-4732a8387081 rootwait rootfstype=ext4 console=ttyS0,115200 console=tty1 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 loglevel=1 ubootpart=afcd1551-01 ubootsource=mmc usb-storage.quirks=   sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16 cgroup_enable=memory swapaccount=1
bootcmd=run distro_bootcmd
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;
bootcmd_fel=if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then echo '(FEL boot)'; source ${fel_scriptaddr}; fi
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_sunxi_compat=setenv root /dev/mmcblk0p3 rootwait; if ext2load mmc 0 0x44000000 uEnv.txt; then echo Loaded environment from uEnv.txt; env import -t 0x44000000 ${filesize}; fi; setenv bootargs console=${console} root=${root} ${extraargs}; ext2load mmc 0 0x43000000 script.bin && ext2load mmc 0 0x48000000 uImage && bootm 0x48000000
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=1
bootfstype=ext4
bootm_size=0xa000000
console=both
consoleargs=console=ttyS0,115200 console=tty1
cpu=armv7
devnum=0
devplist=1
devtype=mmc
dfu_alt_info_ram=kernel ram 0x42000000 0x1000000;fdt ram 0x43000000 0x100000;ramdisk ram 0x43300000 0x4000000
disp_mem_reserves=off
disp_mode=1920x1080p60
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
docker_optimizations=on
ethaddr=02:42:5a:ab:f9:d4
fdt_addr_r=0x43000000
fdtcontroladdr=4bf4f0a0
fdtfile=sun8i-h2-plus-nanopi-duo.dtb
fileaddr=43000000
filesize=8a38
initrd_high=0xFFFFFFFF
kernel_addr_r=0x42000000
load_addr=0x44000000
loadsplash= for prefix in ${boot_prefixes}; do if test -e mmc 0 ${prefix}boot.bmp; then load mmc 0 ${splashimage} ${prefix}boot.bmp; bmp d ${splashimage}; fi; done
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
mmc_bootdev=0
overlay_error=false
overlay_prefix=sun8i-h3
overlays=usbhost2 usbhost3
partitions=name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};name=loader2,size=984k,uuid=${uuid_gpt_loader2};name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};name=system,size=-,uuid=${uuid_gpt_system};
partuuid=afcd1551-01
preboot=run loadsplash; usb start
pxefile_addr_r=0x43200000
ramdisk_addr_r=0x43300000
rootdev=UUID=ed18df55-26a6-4886-97bb-4732a8387081
rootfstype=ext4
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x43100000
serial#=02c000425aabf9d4
soc=sunxi
splashimage=66000000
splashpos=m,m
stderr=serial
stdin=serial,usbkbd
stdout=serial
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
uuid_gpt_esp=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
uuid_gpt_system=69dad710-2ce4-4e3c-b16c-21a1d49abed3
verbosity=1

Environment size: 4266/131068 bytes

 

When i build image for Orange Pi Zero and NanoPi M1+ all fine.

Link to comment
Share on other sites

13 minutes ago, drapas said:

I didn't understand exactly how it influence to boot?

 

Me neither but its pretty irrelevant. I noticed that building of Ubuntu(s) is/are failing with lots of errors and systemd has this issue. It is highly possible that this is related. I can give you detail report in a few weeks, but then it will be irrelevant again.

Link to comment
Share on other sites

5 hours ago, Igor said:

failing with lots of errors


In case you were installing INSTALL_HEADERS="yes" you could run out of space. Affected Ubuntu builds and was fixed. But this systemd problem remains.

Link to comment
Share on other sites

did it!

 

# apt list | grep systemd |grep "["

libpam-systemd/xenial-security,xenial-updates,xenial-security,xenial-updates,now 229-4ubuntu21.9 armhf [установлен]
libsystemd0/xenial-security,xenial-updates,xenial-security,xenial-updates,now 229-4ubuntu21.9 armhf [установлен]
systemd/xenial-security,xenial-updates,xenial-security,xenial-updates,now 229-4ubuntu21.9 armhf [установлен]
systemd-sysv/xenial-security,xenial-updates,xenial-security,xenial-updates,now 229-4ubuntu21.9 armhf [установлен]


# apt list -a systemd

systemd/xenial-security,xenial-updates,xenial-security,xenial-updates,now 229-4ubuntu21.9 armhf [установлен]
systemd/xenial,xenial 229-4ubuntu4 armhf

# apt-get install libpam-systemd=229-4ubuntu4 libsystemd0=229-4ubuntu4 systemd=229-4ubuntu4 systemd-sysv=229-4ubuntu4
 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines