Looking to submit a support request? We are now a Perforce company, please submit any requests on our new support page.
Follow

Server Command Line Linux

This article lists useful server commands to be used on Linux distributions where a Hansoft Server is already installed. These can be useful for troubleshooting and maintaining your Hansoft Server.

If you are upgrading or installing a new version of Hansoft, please look at these articles instead:

HPMServer

In the install directory of the Hansoft Server you will find the main executable HPMServer that accepts the following commands.

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.

 

After the -Install Command:

-ServerName <name > Name of server.
-ServerHostname <name> Hostname server is accessed through.
-Port <port> Port server should listen to.
-ServerAdminPassword <password> The password for server administrator client.
-DatabaseName <name Create database with name.
-DatabaseAdminPassword <password> Password for 'Administrator' in created database.
-SMTPServer <server address> Email notifications SMTP server.
-SMTPPort <port> Email server port.
-EmailFromName <name> Name appearing as from on emails.
-EmailFrom <email address> Email Address appearing as from on emails.
-EmailSubject <subject> Subject of email notifications.
-EmailToEmail <target address> Email to send notifications to.
-Service <name> The unique name of the service.
-RunAsUser <name> The user to run the service as.
-ServerName <name> Name of server.

 

-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.

Other useful commands

The commands below assume that the name of your Hansoft service is HPServer.

Command Description
journalctl -u HPServer.service The systemd journal. Learn more here.
systemctl status HPServer Will give you the status of the service. Learn more here

Logs

Location Description
 HansoftServer/Log/  The default Hansoft Server log with all the details of the Hansoft Server.
/var/log/messages/  The general system activity log that may contain important information when troubleshooting the Hansoft service.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request