I think ChatGPT might have found the problem -- the status = 200/CHDIR. Not sure if other stuff applies here, but try it and let me know how it went:
The error you're encountering is a status=200/CHDIR error, which suggests that the service is failing because it cannot change into the working directory specified in your systemd service file. This can occur when the directory doesn't exist, the user running the service doesn't have the proper permissions to access it, or a similar issue related to the filesystem.
Here's how you can troubleshoot this problem:
Check the Directory Exists: Ensure that the directory /home/apple/metabase/ exists and that the Metabase JAR is indeed located there.
Correct Permissions: Verify that the user under which the systemd service is running has appropriate permissions to read the Metabase JAR file and execute it.
Check Service Definition: Inspect /etc/systemd/system/metabase.service to ensure that there are no typos and that all paths are correct. Make sure that the User= directive is set to the correct user if it's meant to be run as apple.
Validate Permissions on the Directory: Verify that the user apple (or the user specified in the service file) has the necessary permissions to access the directory and files. You can do this using the following commands:
sudo -u apple ls /home/apple/metabase/
If the user cannot access that directory, you may need to change the permissions using chown and chmod commands.
5. Check for SELinux/AppArmor: If your system is running SELinux or AppArmor, they may be preventing systemd from changing the directory to the one specified in the service file. Make sure that the security context is correct or that the necessary allowances are made in your security policies.
6. Restart systemd Daemon: If you've made changes to the service file, remember to reload the systemd manager configuration with:
sudo systemctl daemon-reload
Try Starting the Service Manually: Try running the java command from the terminal as the apple user to see if there are any immediate errors:
sudo -u apple java -jar /home/apple/metabase/metabase.jar
Service Restart: Attempt to start the service again and observe any errors:
sudo systemctl start metabase.service
Check System Logs: Since the /var/log/metabase.log is not being populated, you might want to check the system journal for error messages:
journalctl -u metabase.service
Adjust the paths and user names as necessary to align with your system's configuration. Take corrective action based on the output of these checks.
Please proceed with caution and ensure that you are comfortable with these commands or have a system administrator validate the changes. A misconfiguration might lead to other services being affected.