Most Popular
Recently Added
Recently Updated

Install SymmetricDS service on Linux with a specific non-root user account

This article describes how to install SymmetricDS daemon on Linux with a specific non-root user account using the command line.

Prerequisites:

Note: The following steps have been verified on Ubuntu Linux 24 LTS.
The default install directory is: /opt/symmetric-ds

STEP 1. Create Linux user group (requires administrator permissions):

Check if Linux user group already exists:

getent group | grep symds

Add new group “symds”:

sudo groupadd --system symds
getent group | grep symds

STEP 2. Create Linux user account (requires administrator permissions):
Check if Linux user account already exists:

id symds

Add new account “symds”:

export SYM_HOME="/opt/symmetric-ds"

echo $SYM_HOME

sudo useradd --system --gid "symds" --no-create-home --shell /usr/sbin/nologin --comment "SymmetricDS service" --home-dir "$SYM_HOME" "symds"

sudo -u symds id symds

STEP 3. Create SymmetricDS home directory (requires administrator permissions):
Check if SymmetricDS home directory already exists

ls "$SYM_HOME" -al

Create SymmetricDS home directory:

sudo -u symds mkdir "$SYM_HOME"
sudo -u symds mkdir "$SYM_HOME/installer"

Copy SymmetricDS setup JAR and answers XML file into the installer subdirectory:
cp {your_path_to_symmetric_installer.jar} "$SYM_HOME/installer"
cp {your_path_to_symmetric_answers.xml} "$SYM_HOME/installer"

STEP 4. Customize the answers.xml file to specify values necessary - for your environment (Important!):
Review current file:

cat "$SYM_HOME/installer/{your_symmetric_answers.xml}"

sudo -u symds nano "$SYM_HOME/installer/{your_symmetric_answers.xml}"

Values to edit/revisit are:

  • key="select.install.upgrade" value="true" for NEW installations
  • installpath - Align with this SYM_HOME directory in this setup.
  • key="select.install.service" value="false" for this example (see step 9)
  • key="select.install.httpPort" value="your_port_goes_here"
  • key="select.install.httpsEnabled" value="false" true is a common option (combine with select.install.httpPort=false !)
  • key="select.memory" value="megabytes_available_on_your_server_minus_os_reservation"
  • key="select.staging.directory" value="tmp"
  • key="select.staging.encrypt" value="true" increases memory requirements
  • key="select.staging.compress" value="true" requires more memory, but less storage space

STEP 5. Set ownership and permissions for the SymmetricDS home directory (requires administrator permissions):

sudo -u symds ls "$SYM_HOME" -al

sudo chown -R "symds:symds" "$SYM_HOME"
sudo chmod -R 750 "$SYM_HOME"

Run the installer with the answers XML (edit XML first to ensure desired effect!):

sudo -u symds java --version
sudo -u symds ls "$SYM_HOME/installer" -al

sudo -u symds java -jar "$SYM_HOME/installer/{your_symmetric_installer.jar}" "$SYM_HOME/installer/{your_symmetric_answers.xml}"

STEP 6. Edit service configuration file to set Linux user account:

sudo -u symds nano "$SYM_HOME/conf/sym_service.conf"

wrapper.run.as.user=symds
(Note: leave empty the wrapper.run.as.password field!)

STEP 7. Register service daemon for SymmetricDS and start it (and verify):

sudo "$SYM_HOME/bin/sym_service" install

sudo systemctl status SymmetricDS

Start service and verify operation:

sudo systemctl start SymmetricDS

sudo -u symds tail "$SYM_HOME/logs/wrapper.log"

Also: reboot the computer and verify that SymmetricDS service starts automatically.

(Optional) To start service you can also use this command:

sudo -u symds "$SYM_HOME/bin/sym_service" start

STEP 8. Monitor main log file for any ERROR messages:

sudo -u symds tail "$SYM_HOME/logs/symmetric.log"

(Optional) To stop the service you can use the following command:

sudo -u symds "$SYM_HOME/bin/sym_service" stop

(Optional) To uninstall the service you can use the following command:

sudo "$SYM_HOME/bin/sym_service" uninstall

Properties ID: 000064   Views: 26   Updated: 5 days ago
Filed under: