I’m debugging a mongodb (7.0) instance which should start via systemctl on AlmaLinux 9 and use a non-default data directory (/data/mongo) – after the typical problems and googling, the file permissions on /data/mongo are set to mongod:mongod. There still are errors that there are insufficient file-permissions – on explicitly that path.
The weird thing is, that if mongod is started via “sudo -u mongod mongod -f /etc/mongod.conf” it works. The systemctl config is set to use that user and weirdly it also works when the default directory is specified.
To summarise:
- it works via systemctl on the default directory
- it works on the non-default dir if started via “sudo -u mongod mongod -f /etc/mongod.conf”
- it doesn’t work via systemctl and the non-default dir
Also checked the uid/gid on the directory and they match what is in passwd …
Any ideas?
Cheers and thanks