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-Software | Node-RED: missing directory #2975

Closed
Orfait opened this issue Jul 9, 2019 · 8 comments
Closed

DietPi-Software | Node-RED: missing directory #2975

Orfait opened this issue Jul 9, 2019 · 8 comments
Labels
Bug 🐞 Solution available 🥂 Definite solution has been done
Milestone

Comments

@Orfait
Copy link

Orfait commented Jul 9, 2019

Information

  • DietPi version :
    G_DIETPI_VERSION_CORE=6
    G_DIETPI_VERSION_SUB=25
    G_DIETPI_VERSION_RC=3
    G_GITBRANCH='master'
    G_GITOWNER='MichaIng'
  • Distro version : stretch
  • Kernel version : Linux DietPi 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux
  • SBC device : RPi 3 Model B (armv7l)

Additional Information

  • Software title : Node-RED
  • DietPi freshly installed, so also fresh install of Node-RED

Steps to reproduce

  1. Install Node-RED
  2. Start service : systemctl start node-red.service

Expected behaviour

Service should be running

Actual behaviour

Service ends with error related to directory

Extra details

If we take a look at /etc/systemd/system/node-red.service :

Description=Node-RED (DietPi)

[Service]
User=nodered
ExecStart=/usr/local/bin/node-red -u /mnt/dietpi_userdata/node-red

[Install]
WantedBy=multi-user.target
  1. The folder /mnt/dietpi_userdata/node-red is missing, create it :
    mkdir /mnt/dietpi_userdata/node-red
  2. Give nodered user permission to this directory :
chown node-red:node-red -R  /mnt/dietpi_userdata/node-red
@MichaIng
Copy link
Owner

MichaIng commented Jul 9, 2019

@Orfait
Many thanks for your report.

Confirmed. Bug introduced with v6.25 in relation with some user creation alignments.

Fixed with: 2924d0e
Permissions are done here: https://github.com/MichaIng/DietPi/blob/master/dietpi/func/dietpi-set_software#L473
Changelog: 91d76d4

  • I will also add a patch to the v6.25 patch file to prevent future updaters from running into this: a3e1da4

To fix now code-wise:

grep -q 'mkdir -p $G_FP_DIETPI_USERDATA/node-red' /DietPi/dietpi/dietpi-software || sed -i '\|cat << _EOF_ > /etc/systemd/system/node-red.service|i\mkdir -p $G_FP_DIETPI_USERDATA/node-red' /DietPi/dietpi/dietpi-software

@marcobrianza
Copy link

marcobrianza commented Jul 22, 2019

hello, stating from a fresh install the user nodered was also missing, created manually and with the above code it fixes.
edit: no it exits again maybe the user nodered needs to be created in different way

@MichaIng
Copy link
Owner

@marcobrianza
Thanks for reporting. Found the issue:

  • If the group "gpio" does not exist, the whole useradd/usermod command fails. This seems to be the case on non SBCs.
  • Can you verify that you tried it on some x86_64 machine?

@marcobrianza
Copy link

yes, it was on virtualbox

@MichaIng
Copy link
Owner

@marcobrianza
Fixed with: cc65890

  • Along with some other failsafe coding where we create or modify run users.

Changelog: d7604ea

@marcobrianza
Copy link

Great quick fix! thank you
I have switched to dev branch (6.26.0) and can confirm that it works.

On the virtual machine I had to modify the file /DietPi/dietpi.txt so I think that instructions at https://github.com/MichaIng/DietPi/blob/master/BRANCH_SYSTEM.md should be updated since modifying /boot/dietpi.txt did not work for me.

@MichaIng
Copy link
Owner

MichaIng commented Jul 23, 2019

@marcobrianza
Great, many thanks for testing.

should be updated since modifying /boot/dietpi.txt did not work for me.

Note: "Beta on Fresh image:", so before booting the first time, it's dietpi.txt from the boot partition or dir.
For "Beta on an existing installation:" it states

G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=beta' /DietPi/dietpi.txt

for beta, respectively "dev" for dev branch 😉. Manually editing the RAMdisk location /DietPi/dietpi.txt has the same result.

But we could make it a bid more clear:

  1. When editing the image from an external system, e.g. before booting the first time:
  2. On a running DietPi system:

@Phil1988
Copy link

Phil1988 commented Jan 8, 2020

Sorry for the late feedback.
I just wanted to report, that this fixes 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

No branches or pull requests

4 participants