bc-agent installation

Requirements

  • Unix operating system
  • Java 8
  • ssh
  • sudo

Installation

  1. download bc-agent distribution file

root# cd /downloads-directory
root# wget http://beyondcron.com/downloads/bc-agent_version_all.deb

root# cd /downloads-directory
root# wget http://beyondcron.com/downloads/bc-agent_version-0.noarch.rpm

user% cd /downloads-directory
user% wget http://beyondcron.com/downloads/bc-agent-version.zip

  1. install package and start daemon

If they do not already exist, installing this package will create the following:

  • operating system user bc-daemon to run bc-agent;
  • directory /opt/bc-agent containing this package;
  • configuration file /etc/default/bc-agent;
  • log file /var/log/bc-agent.log on initd systems;

It will also register and start bc-agent as a service.

root# dpkg -i bc-agent_version_all.deb

root# rpm -i bc-agent_version-0.noarch.rpm

if the package cannot find a version of Java 8 already installed, the installation will fail.

Starting/stopping

On init systems, the bc-agent service can be started and stopped using the service command. e.g.

root# service bc-agent (start|stop)

On systemd systems, the bc-agent service can be started and stopped using the systemctl command. e.g.

root# systemctl (start|stop) bc-agent

Logging

On init systems, output is written to the file /var/log/bc-agent.log.

On systemd systems, output is written to the systemd journal and can be viewed using journalctl. e.g.

root# journalctl -u bc-agent

  1. move to the install directory

The distribution will will create the sub-directory bc-agent.

user% cd /install-directory

  1. unzip distribution

user% unzip /downloads-directory/bc-agent-version.zip

  1. confirm installation

user% ./bc-agent/bin/bc-agent —version

bc-agent version

Configuring ssh

In order to execute commands on remote servers, bc-agent expects the bc-agent user to have passwordless ssh access to each remote server.

Configuring sudo

When not running as root (the default configuration), bc-agent will attempt to execute jobs, locally and remotely, via sudo. As such you must allow the bc-agent user, default is bc-daemon, to execute commands for other users.

When not running as root (the default configuration), bc-agent will attempt to execute jobs, locally and remotely, via sudo. As such you must allow the bc-agent user, to execute commands for other users.

A minimal entry within the /etc/sudoers to allow the agent to execute commands for any user exception, would be:

username ALL=(ALL,!root) NOPASSWD:SETENV: ALL

If you wish to allow the BeyondCron agent to execute commands as root, the safest option is to explicitly define each command that you wish to allow the agent to execute. e.g.

username ALL=(ALL,!root) NOPASSWD:SETENV: ALL, (root) /sbin/reboot

if sudo is configured with a secure path, and you wish to allow BeyondCron/users to set the PATH environment variable, you can add the bc-agent user to the sudoers exempt_group. e.g.

Defaults exempt_group += bc-daemon

See also