2017-08-25 52 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就是您需要執行的所有操作。

相關問題