Dietpi: dietpi-update fails to set files/file permissions in /run/dietpi

Created on 4 May 2020  路  20Comments  路  Source: MichaIng/DietPi

Required Information

  • DietPi version | cat /boot/dietpi/.version

G_DIETPI_VERSION_CORE=6
G_DIETPI_VERSION_SUB=29
G_DIETPI_VERSION_RC=2
G_GITBRANCH='master'
G_GITOWNER='MichaIng'

  • Distro version | echo $G_DISTRO_NAME or cat /etc/debian_version

buster

  • Kernel version | uname -a

Linux hostname 4.19.97+ #1294 Thu Jan 30 13:10:54 GMT 2020 armv6l GNU/Linux

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

RPi Zero W (armv6l)

(as well as rpi3b+/armv7l and another rpi zero w - it's all the same)

  • Power supply used | (EG: 5V 1A RAVpower)

5V / 2A dedicated

  • SDcard used | (EG: SanDisk ultra)

SanDisk Extreme 64GB

Additional Information (if applicable)

  • Can this issue be replicated on a fresh installation of DietPi?

not sure

Steps to reproduce

  1. sudo dietpi-update
  2. reboot
  3. login (via ssh)

Expected behaviour

  1. the actual file(s) should exist (or be touched)
  2. the permissions should be "right" (depends on the files, but .network definitely needs 666)
    (maybe: 3. ownership should be right)

Actual behaviour

error message:

/boot/dietpi/func/dietpi-banner: line 222: /run/dietpi/.dietpi_motd: no permission
/boot/dietpi/func/obtain_network_details: line 143: /run/dietpi/.network: no permission

Extra details

Nothing to declare ;-)

Bug Solution available

Most helpful comment

@Joulinar @PeterLacknase
Dammit, chown was used where chmod was wanted... Just fixed it: https://github.com/MichaIng/DietPi/commit/8fd97bc60bce31e14af964504077318479a0f43b

Too few people (including me) use non-root users regularly it seems, so it slipped through the long beta phase.

All 20 comments

Many thanks for your report. What user you use to perform the activities?

update:

  1. sudo -s
  2. dietpi-update

woes no errors/whatsoever

  1. reboot

login:

  1. ssh -vvv localuser@machine

above errors

So you are using an own created user and not root or dietpi?

For updates/system activities: root (via sudo -s)
For login: private user (via ssh)

But not for login after reboot, correct?

correct

@PeterLacknase
Many thanks for reporting. Strange, the .network permissions should have been set by: https://github.com/MichaIng/DietPi/blob/master/dietpi/patch_file#L98
From next reboot on, it should be created with correct permissions on boot: https://github.com/MichaIng/DietPi/blob/master/dietpi/boot#L60-L63

I'll check. Meanwhile for MOTD, this fixes it: https://github.com/MichaIng/DietPi/commit/31747d2256d5ee049a73ef714c675f72024e2233

@MichaIng
nope files are created with read only. But it should be write as well as it was on v6.28, isn't?

dietpi@DietPiVM3:~$ ls -la /run/dietpi/
total 8
drwxr-xr-x  2 root root   80 May  4 11:43 .
drwxr-xr-x 15 root root  460 May  4 11:43 ..
-rw-r--r--  1 root root 1649 May  4 11:52 .dietpi_motd
-rw-r--r--  1  666 root   51 May  4 11:42 .network
-rw-r--r--  1 root root    2 May  4 11:43 .timesync_exit_status
dietpi@DietPiVM3:~$

sure. And the owner id shouldn't be set to the number of the beast. >.)

@MichaIng
I tried dev branch and /run/dietpi has 777 now but files inside created still with read only for non-root user

root@DietPiVM1:/run/dietpi# ls -la /run|grep die
drwxrwxrwx  2 root root  100 May  4 12:01 dietpi
root@DietPiVM1:/run/dietpi# ls -la /run/dietpi/
total 12
drwxrwxrwx  2 root root  100 May  4 12:01 .
drwxr-xr-x 16 root root  480 May  4 12:01 ..
-rw-r--r--  1 root root 1649 May  4 12:01 .dietpi_motd
-rw-r--r--  1  666 root   51 May  4 12:01 .network
-rw-r--r--  1 root root    2 May  4 12:01 .timesync_exit_status
root@DietPiVM1:/run/dietpi#

@Joulinar @PeterLacknase
Dammit, chown was used where chmod was wanted... Just fixed it: https://github.com/MichaIng/DietPi/commit/8fd97bc60bce31e14af964504077318479a0f43b

Too few people (including me) use non-root users regularly it seems, so it slipped through the long beta phase.

Too few people (including me) use non-root users regularly it seems, so it slipped through the long beta phase.

jup was thinking the same already. Will change me testing approach next time.

I'll wait a few hours, just in case something else appears, and then release v6.29.3 as hotfix. It is nothing urgent but simply ugly.

jup was thinking the same already. Will change me testing approach next time.

Yes, it is impossible to test really everything, but one login as non-root, including some autostart options, should be put into the testing schedule. Probably we should write down the steps that make sense to test and could even split this up then across all who are willing to help. Also nice for beta testers.

what about the .dietpi_motd ??

ok will do some test on dev once I'm back home

@all:

many thanks!

@MichaIng
ok did a test on my RPi3B+ with 2 users. Seems ok so far

I also pushed fix via MOTD hack 馃槈. But Let's see the fstab bug that may require a hotfix release anyway.

yes there are more thinks that would need attention next to fstab

Was this page helpful?
0 / 5 - 0 ratings