Install metronome on Centos 7.2: some suggest and issue

Discussion in 'Installation/Configuration' started by DarioL, Oct 21, 2016.

  1. DarioL

    DarioL Member

    Yes, I have read this:
    But I'm a Centos's / Fedora user and I have try help you to support more and better this distro.
    This is my procedure to install metronome on Centos 7.2:
    Code:
    # Metronome XMPP
    yum -y install  prosody libidn libidn-devel libidn2 libidn2-devel lua-filesystem  openssl-devel  lua-expat  lua-bitop lua-socket lua-sec luarocks lua-devel libevent-devel git
    # Open 9418 outgoing port on firewall for git
    luarocks install lpc
    luarocks install luaevent
    luarocks install lua-zlib
    
    useradd --no-create-home --shell=/bin/nologin -c ‘Metronome’ metronome
    
    cd /opt
    git clone https://github.com/maranda/metronome.git metronome
    cd ./metronome
    ./configure  --prefix=/usr --with-lua-include=/usr/include/
    make
    make install
    
    cp -a /etc/metronome/metronome.cfg.lua /etc/metronome/metronome.cfg.lua.orig
    
    # Enablei metronome services
    (
    cat << EOF
    [Unit]
    Description=Metronome Server XMPP
    After=syslog.target network.target
    [Service]
    Type=forking
    User=metronome
    Group=metronome
    ExecStart=/usr/bin/metronomectl start
    ExecStop=/usr/bin/metronomectl stop
    ExecReload=/usr/bin/metronomectl reload
    PIDFile=/var/run/metronome/metronome.pid
    Restart=always
    [Install]
    WantedBy=multi-user.target
    EOF
    ) | tee /usr/lib/systemd/system/metronome.service
    
    systemctl enable metronome.service
    systemctl start metronome.service
    
    All seem work fine and service is on.
    But like the initial disclaim say, probably the install procedure is not ready to setup it on Centos 7 with systemd because it try to create a systemV service into /etc/init.d/metronome.
    And I stop here, I'm not a php programmer, and I can't help you to find how to modify install.
    The only thing I have do before run ispconfig setup is this:
    Code:
    # ISPconfig
    cd /tmp
    wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
    tar xfz ISPConfig-3-stable.tar.gz
    cd ispconfig3_install/install/
    (
    cat << EOF
    --- ./lib/installer_base.lib.php.orig   2016-10-18 13:04:40.210396460 +0200
    +++ ./lib/installer_base.lib.php        2016-10-18 13:04:51.998396348 +0200
    @@ -1640,9 +1640,9 @@
             }
    
             // Copy init script
    -        caselog('cp -f apps/metronome-init /etc/init.d/metronome', __FILE__, __LINE__);
    -        caselog('chmod u+x /etc/init.d/metronome', __FILE__, __LINE__);
    -        caselog('update-rc.d metronome defaults', __FILE__, __LINE__);
    +        //caselog('cp -f apps/metronome-init /etc/init.d/metronome', __FILE__, __LINE__);
    +        //caselog('chmod u+x /etc/init.d/metronome', __FILE__, __LINE__);
    +        //caselog('update-rc.d metronome defaults', __FILE__, __LINE__);
    
             exec($this->getinitcommand($conf['xmpp']['init_script'], 'restart'));
    php -q install.php
    EOF
    ) | patch -p0
    
    But when the install procedure work, at the end of metronome ssl certificate generation write this:
    Code:
    Configuring Metronome XMPP Server
    writing new private key to 'localhost.key'
    ....
    Failed to restart .service: Unit name .service is not valid.
    
    Another issue I have found after ispconfig is installed with metronome is generate from the empty folder /etc/metronome/hosts/.
    This generate a metronome configuration error and service do not start because missing at least one VirtualHost
    I have resolve this issue whit this hack:
    Code:
    echo 'VirtualHost "localhost"' > /etc/metronome/hosts/localhost.cfg.lua
    systemctl restart metronome.service
    
    Someone have some suggest to try modify the ispconfig setup procedure to allow the metronome support also to Centos 7.2?
    I'm available to do some test on a new server to be installed.
    Many thanks for your reply
    Dario Lesca
     

Share This Page