Hey there,

i am working on a small server solution for our restaurants. We have a cash desk solution called Gastronovi ( We used RaspPi3 till now and with the switch to the new RP4 i thought i gave DietPi a try.

I installed DPi headless. (SSH worked fine. Thanks!) Than installed java and the printserver application:

apt-get install default-jre

mkdir /opt/gn_server/
cd /opt/gn_server/

nano /etc/systemd/system/gn_server.service

Description=GN Server

ExecStart=/usr/bin/java -jar /opt/gn_server/gn_server.jar

systemctl start gn_server
systemctl enable gn_server

Now the server is accessable via the same network via the (example) IP adress

There is an update button where I can request to check for an update. Unfortunatly I always get the following result:

Update failed: Update has failed. Please try again!! ( /opt/gn_server/gn_server.jar_update (Permission denied))

I mean obviously it is something with permissions… But I have no idea how to solve this.

Any solution? Would appriciate help.


No one? :cry:

Your systemd unit contains: User=nobody
This is a user that is meant to have no write permissions to any file/dir that does not have global write permissions mode.

So you have two possibilities:
chmod -R 777 /opt/gn_server
But this means that every user has full R/W + execute permissions to your service dir, which is in most cases not what you want.

Better create a separate system user to run the program, e.g.:

useradd -rMU -d /opt/gn_server -s $(command -v nologin) gnserver
chown -R gnserver:gnserver /opt/gn_server
G_CONFIG_INJECT 'User=' 'User=gnserver' /etc/systemd/system/gn_server.service
systemctl daemon-reload
systemctl restart gn_server

The user gnserver has no password or login shell attached, hence it is a pure system user that you cannot “login” with.
It has not much permissions, but full R/W access to you service dir, which is also its home dir, hence updates should work now.
You could further reduce permissions of the user or the systemd unit/service itself:

I hope this helps.