nexus用普通用户设置开机自启

在搭建maven私服nexus时,创建了nexus用户用来做nexus的用户,设置了只能通过普通用户启动nexus,而chkconfig --add nexus是用root用户开机自启的。要启动nexus必须切换到nexus用户才行

解决方法

既然chkconfig --add nexus行不通,只能通过脚本加入/etc/rc.local去做开机自启了,最后在/etc/rc.local文件添加su nexus -c "service nexus restart"解决了,reboot重启后发现nexus已经启动。
注意的是/etc/rc.d/rc.local要加执行权限chmod +x /etc/rc.d/rc.local
在这里插入图片描述

Logo

更多推荐