无法创建/运行/activemq.pid:权限被拒绝

无法创建/运行/activemq.pid:权限被拒绝,activemq,ubuntu-16.04,Activemq,Ubuntu 16.04,我正在尝试在Ubuntu 16.04上运行ActiveMQ。要启动ActiveMQ,我运行此命令 /opt/apache-activemq-5.15.10/bin/linux-x86-64$ sudo activemq start 它会导致以下错误: INFO: Loading '/usr/share/activemq/activemq-options' INFO: Using java '/usr/lib/jvm/default-java//bin/java' INFO: Starting

我正在尝试在Ubuntu 16.04上运行ActiveMQ。要启动ActiveMQ,我运行此命令

/opt/apache-activemq-5.15.10/bin/linux-x86-64$ sudo activemq start
它会导致以下错误:

INFO: Loading '/usr/share/activemq/activemq-options'
INFO: Using java '/usr/lib/jvm/default-java//bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: changing to user 'activemq' to invoke java
-su: 3: cannot create /run/activemq.pid: Permission denied
INFO: pidfile created : '/run/activemq.pid' (pid '23718')

如输出中所述,脚本更改为
activemq
用户:

INFO: changing to user 'activemq' to invoke java
但是,用户
activemq
无权在
/run
目录中创建文件
activemq.pid


您应该授予用户
activemq
/run
目录中创建文件
activemq.pid
的权限,或者使用
activemq\u user
环境变量指定有权在
/run
目录中创建文件
activemq.pid
的用户添加生成该日志的代码,以便有人提供帮助you@LorenzoIsidori我已经用编辑过的部分编辑了我的问题。如果需要,请检查并让我知道更多信息。进程将用户更改为activemq,可能的情况是activemq用户没有写入
/run
的权限。