Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dietpi-update fails to set files/file permissions in /run/dietpi #3505

Closed
PeterLacknase opened this issue May 4, 2020 · 20 comments · Fixed by #3526
Closed

dietpi-update fails to set files/file permissions in /run/dietpi #3505

PeterLacknase opened this issue May 4, 2020 · 20 comments · Fixed by #3526
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Milestone

Comments

@PeterLacknase
Copy link

PeterLacknase commented May 4, 2020

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 ;-)

@Joulinar
Copy link
Collaborator

Joulinar commented May 4, 2020

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

@PeterLacknase PeterLacknase changed the title dietpi-update fails to set files/file permissions dietpi-update fails to set files/file permissions in /run/dietpi May 4, 2020
@PeterLacknase
Copy link
Author

PeterLacknase commented May 4, 2020

update:

  1. sudo -s
  2. dietpi-update

woes no errors/whatsoever

  1. reboot

login:

  1. ssh -vvv localuser@machine

above errors

@Joulinar
Copy link
Collaborator

Joulinar commented May 4, 2020

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

@PeterLacknase
Copy link
Author

PeterLacknase commented May 4, 2020

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

@Joulinar
Copy link
Collaborator

Joulinar commented May 4, 2020

But not for login after reboot, correct?

@PeterLacknase
Copy link
Author

correct

@MichaIng
Copy link
Owner

MichaIng commented May 4, 2020

@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: 31747d2

@Joulinar
Copy link
Collaborator

Joulinar commented May 4, 2020

@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:~$

@PeterLacknase
Copy link
Author

PeterLacknase commented May 4, 2020

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

@Joulinar
Copy link
Collaborator

Joulinar commented May 4, 2020

@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#

@MichaIng
Copy link
Owner

MichaIng commented May 4, 2020

@Joulinar @PeterLacknase
Dammit, chown was used where chmod was wanted... Just fixed it: 8fd97bc

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

@MichaIng MichaIng added Bug 🐞 Solution available 🥂 Definite solution has been done and removed Investigating 🤔 labels May 4, 2020
@Joulinar
Copy link
Collaborator

Joulinar commented May 4, 2020

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.

@MichaIng
Copy link
Owner

MichaIng commented May 4, 2020

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.

@Joulinar
Copy link
Collaborator

Joulinar commented May 4, 2020

what about the .dietpi_motd ??

@MichaIng
Copy link
Owner

MichaIng commented May 4, 2020

@Joulinar
MOTD is fixed with: 31747d2

@Joulinar
Copy link
Collaborator

Joulinar commented May 4, 2020

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

@PeterLacknase
Copy link
Author

@ALL:

many thanks!

@Joulinar
Copy link
Collaborator

Joulinar commented May 4, 2020

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

@MichaIng
Copy link
Owner

MichaIng commented May 7, 2020

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

@Joulinar
Copy link
Collaborator

Joulinar commented May 7, 2020

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

@MichaIng MichaIng added this to the v6.30 milestone May 10, 2020
@MichaIng MichaIng linked a pull request May 10, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants