Skip to content

Launching programs

At startup Sklad, Casa and Service have to settle three things: which database to connect to, which workstation profile to work under, and how much detail to write to the log. The answers come from three sources - the settings.yaml file, environment variables, and command line parameters.

Setting Command line Environment variable settings.yaml Default
Database server dbserver= - database.servers localhost
Database alias dbname= - database.name abacus
Database user - ABACUS_DBUSER database.username sysdba
Database password - ABACUS_DBPASS database.password masterkey
Profile profile= ABACUS_PROFILE profile default
Log level loglevel= - log.level 3

The sources are listed in descending order of precedence: a command line parameter overrides an environment variable, and a variable overrides the file.

The settings.yaml file

The file sits next to the program's executable and is created by the installer from the answers you gave during installation. It is the only configuration file the programs read from disk: everything else - menus, grids, rights, hardware, workstations - is kept in the database.

database:
  name: abacus
  servers:
    - 192.168.123.1
    - 172.27.20.100
  username: AtFrRwlWl7xf
  password: HyArGd5FS8go
log:
  level: 3
  maxsizekb: 10240
  keepfiles: 10
profile: kasa1
Key Default Description
database.name abacus Database alias on the server, or the full path to its file
database.servers localhost List of servers. The program tries them top to bottom and works with the first one that answers. This is how seamless operation over VPN and on the local network is configured
database.username sysdba Firebird user name, in encoded form
database.password masterkey Firebird password, in encoded form
profile default Name of the workstation profile the program uses to read its storage, cash desk, monitor and hardware settings from the database
log.level 3 How much detail reaches the log
log.maxsizekb 10240 Size at which the log is moved to the archive
log.keepfiles 10 How many log files to keep in the directory

The log block is described in detail under Logs.

The user name and password are stored encoded, so typing them in as plain text will not work - the program will not understand such a value and will fail to connect. The encoded value is written by the installer and by the Launcher (when you enter a connection in the node tree). To run the program under a different database user just once, use the environment variables - they take plain text.

If the file is missing entirely, the program connects to localhost:abacus as sysdba and looks up its workstation settings by the computer's IP address rather than by profile - the way versions before 3.3 worked. If the file exists but has no profile key, the default profile is used.

The default profile has no service tokens and cannot be given any - neither the configuration editor nor the Launcher offers it. So on a workstation that uses abhard, abasyn or abrest, fill the profile key with the name of a real profile, or the program will find no token at all.

Configuration from earlier versions, kept in a settings.ini file, is rewritten into settings.yaml at the first start and the old file is deleted. An old-style settings.yaml, where the server and the alias were a single string in the name key, is likewise converted automatically. Nothing has to be moved across by hand.

Command line parameters

Parameters are written as key=value, separated by spaces, with no dashes and no slashes:

Sklad.exe dbserver=192.168.50.11 dbname=abacus profile=cashdesk1

Case matters: Profile= will not work. Values containing spaces go in quotes - profile="Cash desk 1". Parameters the program does not recognise are skipped silently, so a misspelled parameter name shows up not as a message but as a program that started with its old settings.

Parameter What it does
dbserver=<server> Replaces the whole server list with the single one given. Standby servers are not used in this run
dbname=<alias> Replaces the database alias. It also accepts the old server:alias form; if dbserver= is present as well, it wins over the server inside dbname=
profile=<name> The workstation profile the program reads its settings from
showdbinfo=true Appends the name, version and build of the connected database to the window title. Useful when the computer has both a live and a test database
genconfig=true Rebuilds the program's standard configuration in the database and exits. Needed when the program will not start because of a damaged configuration - see Configuration
loglevel=<0-3> Log detail level for this run. Useful when support asks for loglevel=3 once, without editing the file

showdbinfo and genconfig may also be written without a value - the parameter name alone is enough to switch it on.

Environment variables

The variables are read once at startup, so they have to be set before the program starts - in the system properties, or in the .bat file the program is started from. Immediately after reading them the program clears them for itself, so they reach neither child processes nor the log.

Variable What it does
ABACUS_DBUSER Firebird user name as plain text. Overrides database.username
ABACUS_DBPASS Firebird password as plain text. Overrides database.password
ABACUS_PROFILE Workstation profile. Overrides profile from the file, but yields to the profile= parameter
ABACUS_TOKEN Employee token for entering Sklad without the login window

Only Sklad understands ABACUS_TOKEN. If the token is valid, the program opens straight away as that employee and shows "Зареєстровано по токену" in the status bar; if it is not, the usual login window appears. The token comes from the AbacusToken field of the launcher.yaml connection the program is started from.

The services (abhard, abasyn, abrest) have no variables of their own. They use the system ones - %PROGRAMDATA%, %LOCALAPPDATA%, %APPDATA% on Windows and $XDG_CONFIG_HOME and $HOME on Linux - to find their configuration; the list of directories is under Service programs.

Command line of the service programs

The services are started by the system rather than by a person, so their parameters are mostly needed during diagnostics.

Parameter What it does
--config <path> or -c <path> Specify the configuration directory (Linux only)
--version or -v Print the version and exit
--run or -r Run as a normal program instead of a service (Linux only)
--install or -i Register the service with the system
--uninstall or -u Remove the service from the system
--help or -h Short list of the parameters

Registering and removing a service is done by the installer and by the packages, so --install and --uninstall are only needed for a manual installation.

--config specifies the configuration directory. If it is empty, the program writes a message to the console and exits. Neither the creation of a default configuration nor the conversion of an old .ini happens in that case.

On Windows the services run only as Windows services: --run does not work there, and installed services start without --config. To make a Windows service take a different configuration, the file has to be put in place of the regular one in C:\ProgramData\Abacus\Conf\ and the service restarted.