# Problem with Enterprise Search Service

**URL:** <https://discuss.elastic.co/t/problem-with-enterprise-search-service/354725>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [March 5, 2024, 11:08am UTC](https://discuss.elastic.co/t/problem-with-enterprise-search-service/354725 "2024-03-05T11:08:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![federica.forti](https://avatars.discourse-cdn.com/v4/letter/f/f17d59/32.png) [@federica.forti](https://discuss.elastic.co/u/federica.forti)\
**Post date:** [March 5, 2024, 11:08am UTC](https://discuss.elastic.co/t/problem-with-enterprise-search-service/354725/1 "2024-03-05T11:08:07Z")

</div>

Hi,

we are trying to install enterprise search as a service.

We have configured the enterprise-search.yml configuration file as needed and are able to start the component as a process.  
However, when we try to start the service with the same user used to start the process, we get the following error:

--

mkdir: cannot create directory ‘log’: Permission denied

--

We tried starting the service in two different modes: systemctl and init.d, with both we get the same error, despite giving the logs folder the necessary permissions.

Below are the two files used to configure the services:  
**systemctl**  
[Unit]  
Description=Enterprise Search  
Documentation=[http://www.elastic.co](http://www.elastic.co)  
Wants=network-online.target  
After=network-online.target

[Service]  
Type=simple  
User=elastic  
Group=elastic

ExecStart=/bin/bash /home/elastic/enterprisesearch/enterprise-search-8.12.1/bin/enterprise-search

StandardOutput=journal  
StandardError=inherit

LimitNOFILE=65536  
LimitMEMLOCK=infinity  
TimeoutStopSec=0  
KillSignal=SIGTERM  
SendSIGKILL=no  
SuccessExitStatus=143

[Install]  
WantedBy=multi-user.target

**init.d**  
#!/bin/bash  
#/etc/init.d/enterprise

DESC="Enterprise Search"  
DAEMON=/home/elastic/enterprisesearch/enterprise-search-8.12.1/bin/enterprise-search  
DAEMON\_ARGS=""  
PIDFILE=/var/run/enterprise.pid  
LOGFILE=/var/log/enterprise-search.log  
USER=elastic  
GROUP=elastic

start() {  
echo "Starting $DESC"  
if [-f "$PIDFILE"]; then  
echo "$DESC is already running."  
exit 1  
fi  
su -s /bin/bash -c "$DAEMON $DAEMON\_ARGS \> $LOGFILE 2\>&1" $USER &  
echo $! \> $PIDFILE  
}

stop() {  
echo "Stopping $DESC"  
if [! -f "$PIDFILE"]; then  
echo "$DESC is not running."  
exit 1  
fi  
kill $(cat $PIDFILE)  
rm $PIDFILE  
}

status() {  
if [-f "$PIDFILE"]; then  
echo "$DESC is running, pid $(cat $PIDFILE)"  
else  
echo "$DESC is not running"  
fi  
}

case "$1" in  
start)  
start  
;;  
stop)  
stop  
;;  
restart)  
stop  
start  
;;  
status)  
status  
;;  
\*)  
echo "Usage: $0 {start|stop|restart|status}"  
exit 1  
;;  
esac

exit 0

Can you help me figure out where the problem is?  
Consider that we tested on AMI LINUX2/RHEL 8/9 and with all of them we get the same problem. SELinux is disabled.

Best regards,  
Federica

---

<div class="post-metadata">

**Author:** ![Sean\_Story](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_story/32/69987_2.png) [@Sean\_Story](https://discuss.elastic.co/u/Sean_Story)\
**Post date:** [March 5, 2024, 3:12pm UTC](https://discuss.elastic.co/t/problem-with-enterprise-search-service/354725/2 "2024-03-05T15:12:17Z")

</div>

> [@federica.forti](#):
>
> despite giving the logs folder the necessary permissions

If I had to guess, you're making an assumption here about which `log` folder, and what the necessary permissions are.

From your pasted configs, I infer that you've unpacked the tarball at `/home/elastic/enterprisesearch/enterprise-search-8.12.1`. Can you do a:

```auto
ls -lah /home/elastic/enterprisesearch/enterprise-search-8.12.1/

```

and share the results?

---

<div class="post-metadata">

**Author:** ![federica.forti](https://avatars.discourse-cdn.com/v4/letter/f/f17d59/32.png) [@federica.forti](https://discuss.elastic.co/u/federica.forti)\
**Post date:** [March 7, 2024, 8:23am UTC](https://discuss.elastic.co/t/problem-with-enterprise-search-service/354725/3 "2024-03-07T08:23:29Z")

</div>

Sean,

Thank you very much for the reply.

We solved the problem: it was related to the 'JAVA\_GC\_LOG\_DIR' property in 'config/env.sh'. This property must be uncommented and configured with a path to the GC logs.

Kind regards,  
Federica

---

<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:** [April 4, 2024, 8:24am UTC](https://discuss.elastic.co/t/problem-with-enterprise-search-service/354725/4 "2024-04-04T08:24:21Z")

</div>

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