Jetty bash脚本仅适用于root用户 [英] Jetty bash script works only with root user

查看:109
本文介绍了Jetty bash脚本仅适用于root用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过提取/opt/jetty中的存档安装了Jetty 9(最新版本).

I have installed Jetty 9 (latest version) by extracting the archive in /opt/jetty.

start.jar运行正常,但是我希望bash服务bin/jetty.sh由非root用户运行.

The start.jar runs fine, but I want the bash service bin/jetty.sh, to be run by a non-root user.

bash脚本存在的问题是:当我未在/etc/default/jetty中指定$JETTY_USER的值(它使用root用户)时,Jetty可以工作.但是,当我为其分配值时,Jetty失败,并显示以下消息:Starting Jetty: FAILED,并且没有日志.

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), Jettyworks. 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?

推荐答案

我遇到了同样的问题.就我而言,我按照逐步安装指南使用jetty.sh启动Unix服务"(请参阅​​eclipse.org上的文档)在pcDuino v3,Ubuntu 14.04上安装了Jetty v 9.2.10.v201503.

I faced the same issue. In my case I installed Jetty v 9.2.10.v201503 on pcDuino v3, Ubuntu 14.04 following step-by-step installation guidelines "Startup a Unix Service using jetty.sh" (see documentation on eclipse.org).

由于这些步骤是作为root用户运行的,因此我最终获得了$ JETTY_BASE目录中文件和目录的混合所有权(root和jetty).

Since the steps are run as root, I ended up with mixed ownership (root and jetty) of files and directories in $JETTY_BASE directory.

我在/etc/default/jetty文件中添加了JETTY_LOGS = $ JETTY_BASE/logs和JETTY_USER = jetty并重新发出chown –R jetty:jetty $ JETTY_BASE.

I added JETTY_LOGS=$JETTY_BASE/logs and JETTY_USER=jetty to the /etc/default/jetty file and reissued chown –R jetty:jetty $JETTY_BASE.

这些步骤之后,Jetty在码头用户的凭据下运行.尽管这很容易,但我希望该说明对那些不是专业管理员的人有用.

After these steps Jetty runs under credentials of jetty user. Though it was pretty easy, I hope that this note might be useful for others who are not professional admins.

这篇关于Jetty bash脚本仅适用于root用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆