Grafana doesnt start from service but from console

Hi everybody,

i already looked up the forum, the error message i get was often discussed, but none of the thread helped me out of my problem. At first, im on an unpriviliged debian LXC Container on Proxmox.

I try to get grafana (actual version from apt install) to get running. When i start grafana-server

from /usr/share/grafana

everything runs fine. But trying to start the service with

systemctl start grafana-server

the application doesnt start, systemctl status grafana-server gives me:

systemctl status grafana-server

x grafana-server.service - Grafana instance
     Loaded: loaded (/lib/systemd/system/grafana-server.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Thu 2023-09-21 16:54:59 CEST; 9min ago
   Duration: 11ms
       Docs: http://docs.grafana.org
    Process: 1146 ExecStart=/usr/share/grafana/bin/grafana server --config=${CONF_FILE} --pidfile=${PID_FILE_DIR}/grafana-server.pid --packaging=deb cfg:default.paths.logs=${LOG_DIR} cfg:default.paths.data=${DATA_DIR} cfg:default.paths.>
   Main PID: 1146 (code=exited, status=226/NAMESPACE)
        CPU: 10ms

Sep 21 16:54:59 automation systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
Sep 21 16:54:59 automation systemd[1]: Stopped grafana-server.service - Grafana instance.
Sep 21 16:54:59 automation systemd[1]: grafana-server.service: Start request repeated too quickly.
Sep 21 16:54:59 automation systemd[1]: grafana-server.service: Failed with result 'exit-code'.
Sep 21 16:54:59 automation systemd[1]: Failed to start grafana-server.service - Grafana instance.
>  journalctl -xeu grafana-server.service
> --
> -- The job identifier is 1419 and the job result is done.
> Sep 21 16:54:58 automation systemd[1]: Started grafana-server.service - Grafana instance.
> -- Subject: A start job for unit grafana-server.service has finished successfully
> -- Defined-By: systemd
> -- Support: 
> --
> -- A start job for unit grafana-server.service has finished successfully.
> --
> -- The job identifier is 1419.
> Sep 21 16:54:58 automation (grafana)[1146]: grafana-server.service: Failed to set up mount namespacing: /run/systemd/unit-root/proc: Permission denied
> Sep 21 16:54:58 automation (grafana)[1146]: grafana-server.service: Failed at step NAMESPACE spawning /usr/share/grafana/bin/grafana: Permission denied
> -- Subject: Process /usr/share/grafana/bin/grafana could not be executed
> -- Defined-By: systemd
> -- Support: 
> --
> -- The process /usr/share/grafana/bin/grafana could not be executed and failed.
> --
> -- The error number returned by this process is ERRNO.
> Sep 21 16:54:58 automation systemd[1]: grafana-server.service: Main process exited, code=exited, status=226/NAMESPACE
> -- Subject: Unit process exited
> -- Defined-By: systemd
> -- Support: 
> --
> -- An ExecStart= process belonging to unit grafana-server.service has exited.
> --
> -- The process' exit code is 'exited' and its exit status is 226.
> Sep 21 16:54:58 automation systemd[1]: grafana-server.service: Failed with result 'exit-code'.
> -- Subject: Unit failed
> -- Defined-By: systemd
> -- Support: 
> --
> -- The unit grafana-server.service has entered the 'failed' state with result 'exit-code'.
> Sep 21 16:54:59 automation systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
> -- Subject: Automatic restarting of a unit has been scheduled
> -- Defined-By: systemd
> -- Support: 
> --
> -- Automatic restarting of the unit grafana-server.service has been scheduled, as the result for
> -- the configured Restart= setting for the unit.
> Sep 21 16:54:59 automation systemd[1]: Stopped grafana-server.service - Grafana instance.
> -- Subject: A stop job for unit grafana-server.service has finished
> -- Defined-By: systemd
> -- Support: 
> --
> -- A stop job for unit grafana-server.service has finished.
> --
> -- The job identifier is 1481 and the job result is done.
> Sep 21 16:54:59 automation systemd[1]: grafana-server.service: Start request repeated too quickly.
> Sep 21 16:54:59 automation systemd[1]: grafana-server.service: Failed with result 'exit-code'.
> -- Subject: Unit failed
> -- Defined-By: systemd
> -- Support: 
> --
> -- The unit grafana-server.service has entered the 'failed' state with result 'exit-code'.
> Sep 21 16:54:59 automation systemd[1]: Failed to start grafana-server.service - Grafana instance.
> -- Subject: A start job for unit grafana-server.service has failed
> -- Defined-By: systemd
> -- Support: 
> --
> -- A start job for unit grafana-server.service has finished with a failure.
> --
> -- The job identifier is 1481 and the job result is failed.

Im doing this all as root, i cant understand the permission denied message. Any solutions?

Best regards

Im also wondering if the service description could be the problem, where are those variables defined given here:

ExecStart=/usr/share/grafana/bin/grafana server                                     \
                            --config=${CONF_FILE}                                   \
                            --pidfile=${PID_FILE_DIR}/grafana-server.pid            \
                            --packaging=deb                                         \
                            cfg:default.paths.logs=${LOG_DIR}                       \
                            cfg:default.paths.data=${DATA_DIR}                      \
                            cfg:default.paths.plugins=${PLUGINS_DIR}                \
                            cfg:default.paths.provisioning=${PROVISIONING_CFG_DIR}

I could resolve the problem, i had to activate nesting for lxc container and reinstall everything. Now it works.

Regards