Creating, managing, and configuring services
The asperarund manages both asperawatchd and asperawatchfolderd. 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, asperarund starts automatically upon installation and runs as a system service (go to and look for asperarund).
Starting the IBM Aspera Run Service
If asperarund 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.
Run the following command to view the state of the service. A running service returns a number in the first column. For example,
$ sudo launchctl list | grep aspera
- 1 com.aspera.asperalee
82 0 com.aspera.asperanoded
- 0 com.aspera.asperarund
102 0 com.aspera.asperacentral
- 1 com.aspera.asperahttpd
If asperarund is not running, load it:
$ sudo launchctl load /Library/LaunchDaemons/com.aspera.asperarund.plist
Configuring services
Configuration settings for asperarund, asperawatchd, and asperawatchfolderd 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:
$ /Library/Aspera/bin/asuserdata -a
For more information on configuring , see:
Configuring asperarund
Logging and the Redis database that was used by asperarund 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 asperarund 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 asperawatchd and asperawatchfolderd 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 asperawatchd under root, and select a user to run asperawatchfolderd 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 asperawatchd and asperawatchfolderd, use the GUI (Managing services in the GUI) or run the corresponding command:
$ /Library/Aspera/sbin/asperawatchd --user username
$ /Library/Aspera/sbin/asperawatchfolderd --user username --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:
$ /Library/Aspera/bin/asrun send [options]
Run asrun send -h to output a complete list of options.
View a list of running services
$ /Library/Aspera/bin/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":"root"
},
"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":"root"
},
"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":
$ /Library/Aspera/bin/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":
$ /Library/Aspera/bin/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.
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":
$ /Library/Aspera/bin/asrun send --delete="d109d1bd-7db7-409f-bb16-ca6ff9abb5f4"
[asrun send] code=0
null