Server command line—Mac

The server commands are used to manage your Hansoft server.

Run commands from the HPMServer.

You will find it in the directory where you installed the server.

The default installation path on Mac is /Applications/Hansoft Server.

Server command example:

sudo ./HPMServer -AddService MyServer01

Creates a new service called MyServer01

Note that some commands will require root access.

Command line Description
-AddService <Service Name> Adds the current executable to the system as a service.
-AddServiceIfNotAdded <Service Name> Adds the current executable to the system as a service if a service with the same name does not exist.
-RemoveService <Service Name> Removes the program from the system server list.
-StartService <Service Name> Attempts to start the service.
-StopService <Service Name> Attempts to stop the service.
-RunAsProgram Runs the server as a usual program in the background.
-Service <Service Name> Starts the program as a service. Only used by the system.
-Uninstall <Service Name> Backs up the database, stops the service and removes the service from the system.
-Install <Service Name> Installs service interactively in console.
-Upgrade Fixes file permissions after upgrade.
-Version Displays the program version.
-ResetAdminPassword Resets the admin password. After invoking this command you will be asked to enter the new password and then re-enter to confirm the change.
-OverridePort <Port> Overrides the port used for this server during this session.
-CreateConfig <Configuration File Creates an initial configuration using a configuration file. -CreateConfig ServerName ServerAdminPassword ServerPort bCreateDatabase [DatabaseName DatabaseAdminPassword].
-UploadDumps <Email Adress> Uploads crash dumps to Hansoft support, the email address is the address you wish support to contact you with.
-BackupAllDatabases Stops listening for connections, gracefully logs out all users and then does a backup of all online databases. Used during upgrades on Windows systems. If you have run this command you need to restart the service to accept connections again.
-BackupAndStop The same as -BackupAllDatabases, but additionally stops the service after all databases have finished backing up. Should be run before upgrades to reset transaction logs.

-CreateConfig Creates a initial configuration from a text file

The file can contain the following key-value pairs:

ServerName "<ServerName>" Optional.
ServerPassword "<Password>" Required. Password for server administrator.
ServerPort "<Port>" Optional.
ServiceName "<ServiceName>" Optional.
DatabaseHostname "<Hostname>" Optional.
DatabaseName "<Name>" Optional.
DatabasePassword "<Password>" Required. Password for database administrator.

To configure the server email functionality the file should also contain the following pairs:

Email_OutgoingServer "<Hostname>" Outgoing email server hostname.
Email_FromName "<Name>" Email Address appearing as from on emails.
EmailSubject "<subject>" Subject of email notifications.
EmailToEmail "<target address>" Sender name.
Email_FromEmail "<Address>" Sender address.
Email_Subject "<Subject>" Subject of email.
Email_SendTo "<Addresses>" Recipients. Seperate multiple entries by comma, semicolon or space.
Email_Authentication "<0/1>" Authentication: 0 = Disable, 1 = Enable.
Email_UserName "<Username>" Email username.
Email_Password "<Password>" Email password.
Email_SecurityProtocol "<0/1/2>" Protocol: 0 = None, 1 = SSL, 2 = TLS.
Email_EmailLog "<0/1>" Log outgoing emails: 0 = Disable, 1 = Enable.
Email_SendTestEmail "<0/1>" Send test email when starting up: 0 = Disable, 1 = Enable.
Email_OutgoingPort "<Port>" Port number.