Jetty bash script works only with root user
jetty, linux
Solution
I know that this question is old, but since this behaviour bugged me recently as well, here it's my hint. In my case it was Jetty 8.x on Centos 6.5, and I had the exact similar behaviour: jetty starting flawlessly when launched on command line both as root and as the newly created jetty user, but failing to start whenever trying to run it as a service and specifying a user through the variable JETTY_USER in /etc/default/jetty. Logs were completely empty.
The trick in my case was that no directory was openly specified for logs in the JETTY_LOGS variable. When run directly as a user, when Jetty can't access a normal directory for logs it will try to create one for the user. With the startup script in Centos/RH systems, though, the process is ran by a 'su - -c "command" user' which seems to break that kind of behaviour. No complain is filed in the logs file, as the process breaks right when trying to access them, and both stdout and stderr are redirected to the logs.
To debug you exact permissions problem, try running the server through a "su -c" like the script does; the difference is that you will finally have your stderr on the console. And for the future, also manually create a jetty logs directory with the right permissions, and specify it inside the JETTY_LOGS variable: much less of an headache!
Problem
I have installed `Jetty 9` (latest version) by extracting the archive in `/opt/jetty`. The `start.jar` runs fine, but I want the bash service `bin/jetty.sh`, to be run by a non-root user. The issue I'm having with the bash script is that : when I dont specify a value for `$JETTY_USER` in `/etc/default/jetty` (it uses `root` user), `Jetty`works. But when I assign a value to it, Jetty fail with the message: `Starting Jetty: FAILED`, and no log. So, how do I create a user that can run the jetty?