将AEM6.3设置为服务Linux Redhat版本7.3

时间:2017-08-25 04:31:14

标签: aem redhat systemd

我正在尝试将 AEM6.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

    [单位]     说明= Adob​​e Experience Manager

    [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. 我已将这两个文件的权限设为 -

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

    #cd /etc/systemd/system
    #systemctl enable aem.system
    
  5. 它给了我以下错误 -

        #systemctl enable aem.system
    
        **Failed to execute operation: No such file or directory**
    

    我错过了这里的任何一步吗?

    谢谢!

1 个答案:

答案 0 :(得分:0)

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

另外:如果链接指南建议确实存在/etc/init.d/aem6文件,那么systemd的SysV兼容层应该能够读取该文件,而systemctl enable --now aem6就是您需要做的一切。