小编Mar*_*ign的帖子

如何以非 root 用户身份运行 init 脚本?

我将此文件放在 /etc/init/proxyserver.conf 中,该文件在启动时执行此脚本(Ubuntu 11.10):

description "Run code for ProxyServer"
start on runlevel [23]

script
    cd /home/mark/selenium-client
    exec java -jar selenium-server-standalone-2.20.0.jar -role hub -port 1111
end script
Run Code Online (Sandbox Code Playgroud)

这工作正常,但如果我在终端中执行此操作:

ps aux | grep selenium
Run Code Online (Sandbox Code Playgroud)

它返回这个屏幕:

root  783   0.0   2.3  680584   23688   ?   Ssl   Apr18   4:45   java -jar selenium-server-standalone-2.20.0.jar -role hub -port 1111
Run Code Online (Sandbox Code Playgroud)

但是我想以非 root 用户身份运行脚本,我该怎么做?

谢谢!

terminal bash ubuntu

3
推荐指数
1
解决办法
5603
查看次数

标签 统计

bash ×1

terminal ×1

ubuntu ×1