Fulltextsearch + elasticsearch live as a service does not work

Elasticsearch live as a service does not work

I have a strange problem, my installation of fulltextsearch + elasticsearch, when run in terminal fulltextsearch:live, works perfectly to index the files in realtime. When I create the service it runs without errors but it doesn’t index the files in real time.

Has anyone experienced this problem?

root@nuvem:~# systemctl status fulltextsearch.service
● fulltextsearch.service - Full Text Search Service for Nextcloud
Loaded: loaded (/etc/systemd/system/fulltextsearch.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2023-06-27 19:24:04 -03; 14min ago
Main PID: 3888 (php)
Tasks: 1 (limit: 23852)
Memory: 49.5M
CPU: 441ms
CGroup: /system.slice/fulltextsearch.service
└─3888 php -f /var/www/nextcloud/occ fulltextsearch:live -s

Jun 27 19:24:04 nuvem systemd[1]: Started Full Text Search Service for Nextcloud.

[Unit]
Description=Full Text Search Service for Nextcloud
After=network.target

[Service]
ExecStart=php -f /var/www/nextcloud/occ fulltextsearch:live -s
ExecStop=php -f /var/www/nextcloud/occ fulltextsearch:stop
User=www-data
Group=www-data
Restart=always

[Install]
WantedBy=multi-user.target

The only thing I see off the top of my head is your missing the working directory in your unit file:

WorkingDirectory=/var/www/nextcloud

Oh, and I’d suggest full paths to the PHP binary.