Knowledge Base Administration Guide

System Services (Daemons)

Simscope and the Tunnel can run as system services, under Linux (RHEL, CentOS, or Ubuntu).

Installing as services allows automatic startup if the machine reboots, and makes software upgrades simpler by just restarting the service.


simscoped

Install Service

To install the simscoped (ie Simscope daemon) service:

> sudo PATH/TO/simscope install-service --config PATH/TO/simscope.config --db DBPATH
Service path: /etc/init/simscoped.conf
Install Simscope Triage:                                        [  OK  ]

NOTE: make sure the service configuration file has a latest link inside, so that version upgrades work automatically for Simscope.

Remove Service

> sudo bin/simscope remove-service
Service path: /etc/init/simscoped.conf
Removing Simscope Triage:                                       [  OK  ]

tunneld

Install Service

To install the tunneld (ie Tunnel daemon) service:

> PATH/TO/simscope-tunnel --install-service --config PATH/TO/tunnel.config
Service path: /etc/init/tunneld.conf
Install Simscope Tunnel:                                        [  OK  ]

Daemon Helpers: Start/Stop/Status

Here are some basic references for working with various init daemons.

How to tell which Daemon service your Linux is using?

Check sysv:

> pidof /sbin/init && echo "sysvinit" || echo "other"

→ If this command prints sysvinit, your system is using SystemV.

Check systemd:

> pidof systemd && echo "systemd" || echo "other"

→ If this command prints systemd, your system is using SystemD.

> ls /usr/share/upstart

→ If you have this directory, your system is likely using upstart.

Upstart (RHEL)

If using upstart in RHEL/CentOS, files are located at:

  • /etc/init/simscoped.conf
> sudo status simscoped
simscoped stop/waiting

To stop either service:

> sudo stop simscoped
simscoped stop/waiting

To start either service:

> sudo start simscoped
simscoped start/running, process 10668

Upstart (Ubuntu)

If using upstart in Ubuntu, files are located at:

  • /etc/init/simscoped.conf

To view the status of a service:

> service simscoped status
simscoped stop/waiting

To stop either service:

> sudo service simscoped stop
simscoped stop/waiting

To start either service:

> sudo service simscoped start
simscoped start/running, process 10668

To restart either service:

> sudo service simscoped restart
simscoped stop/waiting
simscoped start/running, process 10668

systemd (CentOS/Ubuntu)

> systemctl status simscoped
simscoped stop/waiting

To stop either service:

> sudo systemctl stop simscoped
simscoped stop/waiting

To start either service:

> sudo systemctl start simscoped
simscoped start/running, process 10668

Debug

Log files

By default, Simscope log files are stored at

  • Stdout: /var/log/simscoped.log
  • Stderr: /var/log/simscoped.err

Note: to dump the log of a systemctl service session, use journalctl:

# Replace SERVICE-NAME with the service
> journalctl -u SERVICE-NAME.service

# Example for simscope
> sudo journalctl -u simscoped.service

Show systemd configuration variables

The systemctl show command shows all available variables for a daemon process.

For example this shows the entire configuration for simscoped:

> sudo systemctl show simscoped

Type=simple
ExitType=main
Restart=on-failure
RestartMode=normal
PIDFile=/run/simscoped.pid
NotifyAccess=none
RestartUSec=100ms
RestartSteps=0
RestartMaxDelayUSec=infinity
RestartUSecNext=100ms
...

To view the descriptions of each configuration option, run:

> man systemd.service