# Unable to start kibana with systemd on ubuntu while manually does

**URL:** <https://discuss.elastic.co/t/unable-to-start-kibana-with-systemd-on-ubuntu-while-manually-does/306925>\
**Category:** Kibana\
**Created:** [June 11, 2022, 3:56am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-with-systemd-on-ubuntu-while-manually-does/306925 "2022-06-11T03:56:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blason](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blason/32/42284_2.png) [@Blason](https://discuss.elastic.co/u/Blason)\
**Post date:** [June 11, 2022, 3:56am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-with-systemd-on-ubuntu-while-manually-does/306925/1 "2022-06-11T03:56:45Z")

</div>

Hi Team,

I am facing a weird isssue. On my ubuntu system I am unable to start kibana process with systemd and its failing while if I am starting from command line or manually it does.

Any clud why? below are the error messages consistently appearing when I try to start using systemd unit

```auto
Jun 10 14:38:17 xxxx kibana[3015650]: FATAL Error: EACCES: permission denied, mkdir '/usr/share/kibana/data'
Jun 10 14:38:17 xxxx systemd[1]: kibana.service: Main process exited, code=exited, status=1/FAILURE
Jun 10 14:38:17 xxxx systemd[1]: kibana.service: Failed with result 'exit-code'.
Jun 10 14:38:17 xxxx audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=kibana comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Jun 10 14:38:20 xxxx audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=kibana comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 10 14:38:20 xxxx audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=kibana comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 10 14:38:20 xxxx systemd[1]: kibana.service: Scheduled restart job, restart counter is at 1.
Jun 10 14:38:20 xxxx audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=kibana comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 10 14:38:22 xxxx kibana[3015681]: FATAL Error: EACCES: permission denied, mkdir '/usr/share/kibana/data'
Jun 10 14:38:22 xxxx systemd[1]: kibana.service: Main process exited, code=exited, status=1/FAILURE
Jun 10 14:38:22 xxxx systemd[1]: kibana.service: Failed with result 'exit-code'.

```

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 11, 2022, 4:08am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-with-systemd-on-ubuntu-while-manually-does/306925/2 "2022-06-11T04:08:11Z")

</div>

What are the permissions on

`/usr/share/kibana/data`  
And  
`/usr/share/kibana`

Perhaps the permissions are not correct.

When you start with systemd Kibana runs as the Kibana user, so if somewhere along the line you started manually or created that directory with another user like root , Kibana may not be able to access that directory.

---

<div class="post-metadata">

**Author:** ![Blason](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blason/32/42284_2.png) [@Blason](https://discuss.elastic.co/u/Blason)\
**Post date:** [June 11, 2022, 6:24am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-with-systemd-on-ubuntu-while-manually-does/306925/3 "2022-06-11T06:24:07Z")

</div>

> [@stephenb](#):
>
> /usr/share/kibana

I believe /usr/share/kibana/data directory does exist? I verfied other installations as well and no such directory exists

```auto
root@xxxx:/home/dnsbsiemadmin# ls -l /usr/share/kibana
total 1444
drwxr-xr-x 2 root root 4096 Mar 9 14:23 bin
-rw-r--r-- 1 root root 3860 Feb 24 04:22 LICENSE.txt
drwxr-xr-x 6 root root 4096 Mar 9 14:23 node
drwxr-xr-x 824 root root 28672 Mar 9 14:23 node_modules
-rw-r--r-- 1 root root 1415584 Feb 24 04:22 NOTICE.txt
-rw-r--r-- 1 root root 740 Feb 24 04:22 package.json
drwxr-xr-x 2 root root 4096 Feb 24 04:22 plugins
-rw-r--r-- 1 root root 3970 Feb 24 04:22 README.txt
drwxr-xr-x 9 root root 4096 Mar 9 14:23 src
drwxr-xr-x 3 root root 4096 Mar 9 14:23 x-pack
root@xxxx:/home/dnsbsiemadmin# ls -l /usr/share/kibana/data
ls: cannot access '/usr/share/kibana/data': No such file or directory

```

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 11, 2022, 2:00pm UTC](https://discuss.elastic.co/t/unable-to-start-kibana-with-systemd-on-ubuntu-while-manually-does/306925/4 "2022-06-11T14:00:01Z")

</div>

What version and how did you install?

Kibana Data [per the docs](https://www.elastic.co/guide/en/kibana/current/deb.html) should be in

**data**  
The location of the data files written to disk by Kibana and its plugins `/var/lib/kibana` `path.data`

```auto
sbrown@stephenb-metrics-test-es1:/usr/share$ sudo ls -la /var/lib/kibana
total 24
drwxr-s--- 4 kibana kibana 4096 Oct 23 2021 .
drwxr-xr-x 41 root root 4096 Oct 26 2021 ..
drwxr-xr-x 4 kibana kibana 4096 May 10 2020 headless_shell-linux
-rw-r--r-- 1 kibana kibana 178 Aug 16 2021 kibana.keystore.bak
drwxr-xr-x 2 kibana kibana 4096 May 10 2020 optimize
-rw-r--r-- 1 kibana kibana 36 May 10 2020 uuid
sbrown@stephenb-metrics-test-es1:/usr/share$ 

```

Note the permissions / users, why your install is looking / trying to put data in the `usr/share/kibana` directory I am unclear. But the error makes a bit sense ... when started with systemd Kibana runs as the `kibana` user so it would not have permissions to read and write in the `/usr/share/kibana` directory.

Perhaps you somehow changed `path.data`

Perhaps clean up and reinstall.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 9, 2022, 2:00pm UTC](https://discuss.elastic.co/t/unable-to-start-kibana-with-systemd-on-ubuntu-while-manually-does/306925/5 "2022-07-09T14:00:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
