2017-08-25 107 views
0

我正在尝试将AEM6.3环境设置为服务并遵循以下步骤。但有一些问题 -将AEM6.3设置为服务Linux Redhat 7.3版

我有RedHat 7.3版的Linux服务器。

我从here以参考

  1. AEM文件 - (在/ usr/bin中/ AEM

    /斌/庆典

    # 
    # /etc/rc.d/init.d/aem6 
    # 
    # 
    # # of the file to the end of the tags section must begin with a # 
    # character. After the tags section, there should be a blank line. 
    # This keeps normal comments in the rest of the file from being 
    # mistaken for tags, should they happen to fit the pattern.> 
    # 
    # chkconfig: 35 85 15 
    # description: This service manages the Adobe Experience Manager java process. 
    # processname: aem6 
    # pidfile: /crx-quickstart/conf/cq.pid 
    
    # Source function library. 
    . /etc/rc.d/init.d/functions 
    
    SCRIPT_NAME=`basename $0` 
    AEM_ROOT=/mnt/crx/author 
    AEM_USER=root 
    
    ######## 
    BIN=${AEM_ROOT}/crx-quickstart/bin 
    START=${BIN}/start 
    STOP=${BIN}/stop 
    STATUS="${BIN}/status" 
    
    case "$1" in 
    start) 
    echo -n "Starting AEM services: " 
    su - ${AEM_USER} ${START} 
    touch /var/lock/subsys/$SCRIPT_NAME 
    ;; 
    stop) 
    echo -n "Shutting down AEM services: " 
    su - ${AEM_USER} ${STOP} 
    rm -f /var/lock/subsys/$SCRIPT_NAME 
    ;; 
    status) 
    su - ${AEM_USER} ${STATUS} 
    ;; 
    restart) 
    su - ${AEM_USER} ${STOP} 
    su - ${AEM_USER} ${START} 
    ;; 
    reload) 
    ;; 
    *) 
    echo "Usage: $SCRIPT_NAME {start|stop|status|reload}" 
    exit 1 
    ;; 
    esac 
    
  2. aem.system(/ etc/systemd/system)(找不到system.d所以放在这个文件systemd

    [单位] 说明=的Adobe体验经理

    [Service] 
    Type=simple 
    ExecStart=/usr/bin/aem start 
    ExecStop=/usr/bin/aem stop 
    ExecReload=/usr/bin/aem restart 
    RemainAfterExit=yes 
    
    [Install] 
    WantedBy=multi-user.target 
    
  3. 我提供权限这两个文件AS-

    #chmod u+rwx /usr/bin/aem 
    #chmod u+rwx /etc/systemd/system/aem.system 
    
  4. 当我给这些命令 -

    #cd /etc/systemd/system 
    #systemctl enable aem.system 
    

它给了我下面的错误 -

#systemctl enable aem.system 

    **Failed to execute operation: No such file or directory** 

我失去了任何一步吗?

谢谢!

回答

0

将自定义单元文件放在/etc/systemd/system中是正确的,因为这是所有解包文件的地方。但是,您的文件应该被称为aem.service。据我所知,systemd不会接收以.system结尾的文件。在旁注中:那些过于自由的文件系统权限实际上是不必要的,755应该足够了。

另外:如果确实存在链接指南中提到的/etc/init.d/aem6文件,systemd的SysV兼容层应该能够读取该文件,并且systemctl enable --now aem6就是您需要执行的所有操作。