Skip to main content

Starting and Stopping on Linux

DBmarlin Sensors​

Database Sensors can be started and stopped via the Instance settings screen. If you see the green shield icon next to the Database target then the sensors is running. If the status icon is red with a question mark then you can mouseover the icon to see the reason it failed to start. The most likely reasons are connectivity issues due to incorrect connection details being entered or lack of connectivity between the DBmarlin server and the taget database instance.

Host Sensors can be started and stopped via the Host settings screen. If you see the green shield icon next to the Database target then the sensors is running. If the status icon is red with a question mark then you can mouseover the icon to see the reason it failed to start. The most likely reasons are connectivity issues due to incorrect connection details being entered or lack of connectivity between the DBmarlin server and the taget host.

DBmarlin Server Processes​

The DBmarlin server is made up of 3 processes: Nginx, Tomcat and PostgreSQL. See the architecture page for more deails. All 3 proceses can be started via a single command start.sh and stopped via stop.sh. You can, if needed, start and stop individual processes using the -n , -t and -p parameters for Nginx, Tomcat and PostgreSQL respectively.

info

The start.sh, stop.sh and status.sh scripts must be run as a dbmarlin user account or other non-root user account with access to the DBmarlin install directory.

start.sh​

Start the 3 DBmarlin server processes.

./start.sh

# Or to start the processes individually
./start.sh -n
./start.sh -t
./start.sh -p

stop.sh​

Stop the 3 DBmarlin server processes.

./stop.sh

# Or to stop the processes individually
./stop.sh -n
./stop.sh -t
./stop.sh -p

status.sh​

Check the status of the 3 DBmarlin server processes.

./status.sh
nginx (Running)
tomcat (Running)
postgres (Running)

systemd startup for Linux​

Systemd is a modern SysV-style init and rc replacement for Linux systems which makes use of many modern Linux kernel features. It provides a system and service manager that runs as PID 1 and starts the rest of the system. Systemd is what is responsible for controlling how services are started, stopped, restarted and otherwise managed on modern Linux distributions.

info

The standard Systemd Service unit files that come with the Linux system or installed by third party applications usually run as root or system user account.

Installing systemd unit files for DBmarlin​

  1. Login as the root user.

  2. DBmarlin comes with 3 Systemd Service unit files for each of the 3 processes and can be found in the scripts/systemd directory wherever you installed DBmarlin.

    cd scripts/systemd
    ls -l
    -rw-rw-r-- 1 dbmarlin dbmarlin 796 Dec 2 01:07 dbmarlin-nginx.service
    -rw-r--r-- 1 dbmarlin dbmarlin 437 Dec 2 01:07 dbmarlin-postgresql.service
    -rw-r--r-- 1 dbmarlin dbmarlin 511 Dec 2 01:07 dbmarlin-tomcat.service
  3. Important. You will first need to edit the file so that they contain the correct path where you have installed DBmarlin. The unit files assume the installation directory to be /opt/dbmarlin but if that is not the case you should replace all references to /opt/dbmarlin with the correct location.

  4. Copy the 3 service unit files to /etc/systemd/system and then run systemctl daemon-reload

    cd scripts/systemd
    cp dbmarlin*.service /etc/systemd/system
    systemctl daemon-reload
  5. systemctl list-unit-files | grep dbmarlin - you should see them listed but disabled which means they won't automatically start on a machine reboot but can be started and stopped manually via systemctl

    systemctl list-unit-files | grep dbmarlin
    dbmarlin-nginx.service disabled
    dbmarlin-postgresql.service disabled
    dbmarlin-tomcat.service disabled
  6. systemctl start - to start the services

    systemctl start dbmarlin-nginx
    systemctl start dbmarlin-tomcat
    systemctl start dbmarlin-postgresql
  7. systemctl status - to get the current status of the services

    systemctl status dbmarlin-nginx
    systemctl status dbmarlin-tomcat
    systemctl status dbmarlin-postgresql
  8. systemctl stop - to stop the services

    systemctl stop dbmarlin-nginx
    systemctl stop dbmarlin-tomcat
    systemctl stop dbmarlin-postgresql
  9. systemctl enable dbmarlin-nginx - to make the service automatically restart on reboot

    systemctl enable dbmarlin-nginx
    systemctl enable dbmarlin-tomcat
    systemctl enable dbmarlin-postgresql

For more on systemd see https://www.redhat.com/sysadmin/getting-started-systemctl

init.d startup for Linux​

Installing init.d files for DBmarlin​

  1. Login as the root user.

  2. DBmarlin comes with 3 init.d files for each of the 3 processes and can be found in the scripts/init.d directory wherever you installed DBmarlin.

    cd scripts/init.d
    ls -l
    -rw-r--r-- 1 dbmarlin dbmarlin 1224 Dec 2 10:48 dbmarlin-nginx
    -rw-r--r-- 1 dbmarlin dbmarlin 1268 Dec 2 10:48 dbmarlin-postgresql
    -rw-r--r-- 1 dbmarlin dbmarlin 1260 Dec 2 10:48 dbmarlin-tomcat
  3. Important. You will first need to edit the file so that they contain the correct path where you have installed DBmarlin. The unit files assume the installation directory to be /opt/dbmarlin but if that is not the case you should replace all references to /opt/dbmarlin with the correct location.

  4. Copy the 3 files to /etc/systemd/init.d

    cd scripts/systemd
    cp dbmarlin* /etc/init.d
  5. Run chkconfig to enable the 3 services.

    chkconfig dbmarlin-postgresql on
    chkconfig dbmarlin-tomcat on
    chkconfig dbmarlin-nginx on
  6. Check they are set to run at run levels 4 and 5

    chkconfig --list | grep dbmarlin
    dbmarlin-nginx 0:off 1:off 2:on 3:on 4:on 5:on 6:off
    dbmarlin-postgresql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
    dbmarlin-tomcat 0:off 1:off 2:on 3:on 4:on 5:on 6:off
  7. Start the services

    service dbmarlin-postgresql start
    service dbmarlin-tomcat start
    service dbmarlin-nginx start