The Aspera Watch Services Manager (asperarund)

The Aspera Watch Services Manager

As of Point-to-Point Client version 3.7.1, Aspera Watches and Watchfolders are managed by the Aspera Watch Service Manager (asperarund), which allows easy management of the asperawatchfolderd and asperawatchd services. Most importantly, asperarund allows admins to start services under different users without having to switch between the different contexts.

The asperarund service starts automatically upon installation, just as other Aspera services (such as Aspera Central) do. You can find asperarund as a system daemon.

If you upgraded from Point-to-Point Client version 3.6.1, and you had the asperawatchd and asperawatchfolderd services enabled and configured, you must manually migrate any services that are run by a user other than root. For more information, see Migrating Watch Services on Upgrade.

The asperarund service stores configurations of asperawatchd and asperawatchfolderd services in its database. These configurations are stored using the following commands:
# /opt/aspera/sbin/asperawatchd --user username
# /opt/aspera/sbin/asperawatchfolderd --user username
The asperarund daemon automatically starts and preserves services in its configuration, restarting services if they fail.

Using the asrun Utility

You can use the asrun utility to view, enable, disable, or delete services.

To view a list of running services, run the following command:

# /opt/aspera/bin/asrun send -g

The output is similar to the following:

[asrun send] code=0, body={"services":[{"id":"52ca847a-6981-47e1-9f9b-b661cf298af1","configuration":{"enabled":true,"run_as":{"user":"root"},"type":"WATCHD"},"state":"RUNNING","state_changed_at":"2016-10-20T19:14:34Z"},{"id":"root","configuration":{"enabled":true,"run_as":{"user":"root"},"type":"WATCHFOLDERD"},"state":"RUNNING","state_changed_at":"2016-10-20T00:11:19Z"}

In the resulting output, find the ID for the service you wish to manage. You can identify the asperawatchd service by seraching for the string: "type":"WATCHD". You can identify the asperawatchfolderd service by searching for the string: "type":"WATCHFOLDERD". The ID for the asperawatchfolderd service is generally the name of the user running the service.

The syntax for disabling, enabling, and deleting a service is similar to the command to retrieve a list of running services:

# /opt/aspera/bin/asrun send --sub-command=watch_service_id
Sub-Command Description
disable Stop a service. The service information is preserved by asrund in the database.
enable Enable a stopped service.
delete Stop a service and remove its entry 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.
Note: If the asrun command runs successfully, asrun returns the following message:
[asrun send] code=0, body=

Usage Examples

Disable the asperawatchfolderd service with "id":"admin":

# /opt/aspera/bin/asrun send --disable="admin"
[asrun send] code=0, body=

Re-enable the asperawatchfolderd service with "id":"admin":

# /opt/aspera/bin/asrun send --enable="admin"
[asrun send] code=0, body=

Delete the asperawatchfolderd service with "id":"admin":

# /opt/aspera/bin/asrun send --delete="admin"
[asrun send] code=0, body=