How to change installation script from Ubuntu to Debian.

December 14, 2014 1k views

I want to install Countly server on Debian. But the script file is not the same with Ubuntu.
The Unbuntu installation script:

I can install all, but I don'w know how to start countly api and dashboard? What is the same with below command in Debian?
start countly-supervisor

Thank you.

2 Answers

countly-supervisor is an Upstart service. Upstart is an init system that is used in Ubuntu systems, while Debian uses the SysV init system.

Luckily, the countly-supervisor service isn't that complex -- it just starts supervisor with a custom config file, so we can copy supervisor's init.d file and replace the path to the config file with the one that countly uses, which is located in config directory in the same directory as the installer. E.g., if the installer's path is /var/countly-supervisor/bin/, the path to the config file would be /var/countly-supervisor/bin/config/supervisord.conf.

First, we'll need to download the supervisor package without installing it and then extract it:

mkdir /tmp/countly-supervisor
cd /tmp/countly-supervisor
apt-get download supervisor
ar x supervisor*.deb
tar zvf data.tar.xz

Then, edit ./etc/init.d/supervisor and replace this line:

DAEMON_OPTS="-c /etc/supervisor/supervisord.conf $DAEMON_OPTS"



(Make sure you replace PATH-HERE with the actual path)

To prevent any conflicts with supervisor itself, we'll use a different PID file. Replace




The PIDFILE variable uses the NAME variable, so changing NAME is enough:


Finally, copy the service file and try starting it:

sudo cp /tmp/countly-supervisor/etc/init.d/supervisor /etc/init.d/countly-supervisor
sudo service countly-supervisor start
  • Hi kamaln7,

    • Many thank. It worked for me. You save my day. Thank you. I have another question. How can I replace string DAEMONOPTS="-c /etc/supervisor/supervisord.conf $DAEMONOPTS" with DAEMONOPTS="-c /etc/init/countly-supervisor.conf $DAEMONOPTS" in /etc/init.d/supervisor file.

    I used like below, but it is wrong.

    sed -i 's/DAEMONOPTS="-c /etc/supervisor/supervisord.conf $DAEMONOPTS"/DAEMONOPTS="-c /etc/init/countly-supervisor.conf $DAEMONOPTS"/g' /etc/init.d/supervisor

    Thank you.
    Truong Pham Son

  • No problem! :) You need to escape the forward slashes and dollar signs so that sed does not parse them as part of the script:

    sed -i 's/DAEMON_OPTS="-c \/etc\/supervisor\/supervisord.conf \$DAEMON_OPTS"/DAEMON_OPTS="-c \/etc\/init\/countly-supervisor.conf \$DAEMON_OPTS"/g' /etc/init.d/supervisor
Have another answer? Share your knowledge.