Creating, managing, and configuring services

The the IBM Aspera Run Service manages both the Aspera Watch service and the Aspera Watch Folders service. It stores both their configurations in its database, automatically starts the services when they are added, and restarts services if they fail. It also enables admins to start services under different users without switching between accounts, and to apply logging and database configurations to all services.

Similar to other Aspera services, the IBM Aspera Run Service starts automatically upon installation and runs as a service in the Windows™ Services list (open Search from the taskbar and type Services).

Starting the IBM Aspera Run Service

If the IBM Aspera Run Service is not running, then you cannot create Watch Folders or start a watch. The service is started automatically during installation, but you might have to start it if it was disabled or stopped.

Open Search from the taskbar and type Services. Locate IBM Aspera Run Service. If the status is not Running, click IBM Aspera Run Service and then, click Start.

Configuring services

Configuration settings for the IBM Aspera Run Service, the Aspera Watch service, and the Aspera Watch Folders service are located in the <server> section of aspera.conf. These can be edited only in the command line or by opening aspera.conf.

To view current service settings, run the following command and look for settings that start with rund, watch, watchd, and watchfolderd:

> asuserdata -a

For more information on configuring , see:

Configuring the IBM Aspera Run Service

Logging and the Redis database that was used by the IBM Aspera Run Service is configured in aspera.conf:

<server>
    ...
    <rund>
        <log_level>log</log_level>
        <log_directory>AS_NULL</log_directory>
        <db_spec>redis:127.0.0.1:31415</db_spec> 
    </rund>
    <watch>
        ...
    </watch>
</server>

Run the corresponding asconfigurator command to edit a setting:

> asconfigurator -x "set_server_data;rund_log_level,log_level"
 > asconfigurator -x "set_server_data;rund_log_dir,path"
 > asconfigurator -x "set_server_data;rund_db_spec,db_spec"
Setting Description Default
log_level The level of detail for the IBM Aspera Run Service logging. Valid values are log, dbg1, and dbg2. log
log_directory Log to the specified directory. The Aspera logging file (Log files).
db_spec Use the specified Redis database, which is defined with the syntax redis:ip_address:port. redis:127.0.0.1:31415 (the localhost on port 31415).

Creating the Aspera Watch Service and the Aspera Watch Folders service

Both the Aspera Watch service and the Aspera Watch Folders service run under system users. These users must have a docroot that is configured for them in aspera.conf and have write permissions to the default log directory if no custom log directory is configured in aspera.conf. Run the Aspera Watch service under svcAspera, and select a user to run the Aspera Watch Folders service as described in Choosing user accounts to run Watch Folder services. For more information, see Starting Aspera Watch Services and creating Watches and Creating a push Watch Folder with aswatchfolderadmin.

To start the Aspera Watch service and the Aspera Watch Folders service, use the GUI (Managing services in the GUI) or run the corresponding command:

> asperawatchd --user username 
 > asperawatchfolderd --user username

A Watch service must be running under a user before a Watch Folders service can be created for that user.

Managing services

Use the GUI (Managing services in the GUI) or the asrun command line utility to view, enable, disable, or delete services.

The general syntax of asrun commands is:

> asrun send [options]

Run asrun send -h to output a complete list of options.

View a list of running services

> asrun send -l

The output is similar to the following:

[asrun send] code=0
{
    "services": [
         {
              "id":"52ca847a-6981-47e1-9f9b-b661cf298af1",
              "configuration": {
                     "enabled":true,
                     "run_as": {
                          "pass": "*****",
                          "user":"svcAspera"
                      },
                      "type":"WATCHD"
               },
               "state":"RUNNING",
               "state_changed_at":"2016-10-20T19:14:34Z"
          },
         {
               "id":"d109d1bd-7db7-409f-bb16-ca6ff9abb5f4",
               "configuration": {
                     "enabled":true,
                     "run_as":{
                          "pass": "*****",
                          "user":"svcAspera"
                      },
                      "type":"WATCHFOLDERD"
               },
               "state":"RUNNING",
               "state_changed_at":"2016-10-20T00:11:19Z"
           }
     ]
}

The Watch Service configuration includes the string "type":"WATCHD" and before this entry in the output, a value for "id". The Watch Folder service includes the string: "type":"WATCHFOLDERD".

Disable a service

Disabling a service stops the service but saves its configuration in the database. Disabled services can be restarted (enabled).

For example, to disable the asperawatchfolderd service with "id":"d109d1bd-7db7-409f-bb16-ca6ff9abb5f4":

> asrun send --disable="d109d1bd-7db7-409f-bb16-ca6ff9abb5f4"
[asrun send] code=0
null

Enable a service

Enabling a stopped service starts the service. This command can be used to restart a service that stops due to an error, without changing the configuration to trigger a reload of the configuration.

For example, to enable the asperawatchfolderd service with "id":"d109d1bd-7db7-409f-bb16-ca6ff9abb5f4":

> asrun send --enable="d109d1bd-7db7-409f-bb16-ca6ff9abb5f4"
[asrun send] code=0
null

Delete a Service

Stop a service and remove its configuration from the database. A deleted service cannot be re-enabled.

Note: When deleting the asperawatchfolderd service, all existing Watch Folders started with that service are also deleted.

For example, to delete the asperawatchfolderd service with "id":"d109d1bd-7db7-409f-bb16-ca6ff9abb5f4":

> asrun send --delete="d109d1bd-7db7-409f-bb16-ca6ff9abb5f4"
[asrun send] code=0
null