Restarting at boot ​

The installation process involves setting up a script called backup-daemon-start.sh, which is a set of instructions to start the Zmanda Pro service. If you're using Zmanda Pro on a Linux system labeled as Other Distribution, you can make the service start again by using the backup-daemon-start.sh script.

For Zmanda Pro to automatically start when your computer restarts, you need to make sure that this script runs every time the system boots up. The way you do this can vary depending on the type of Linux system you have. Below are some options you can choose from, depending on what works best for your Linux system.

  1. Preserve HOME environment variable:

    • Zmanda Pro relies on the $HOME environment variable for storing credentials.

    • When configuring Zmanda Pro to launch with your system, make sure that $HOME is properly set, for example, to /root/. This means specifying the home directory correctly to ensure smooth operation.

    • If there's an issue, try running: HOME=/root/ /opt/ZmandaPro/backup-daemon-start.sh &.

    • Zmanda Pro automatically defaults to /root/ if $HOME is not set or is an empty path.

Installation as Root or with 'sudo':

  • Running the .run script as root user might produce outcomes different from those achieved with 'sudo'.

  • When using 'sudo' on Ubuntu, the $HOME environment variable retains the home directory of the current user. In contrast, on Debian, 'sudo' sets $HOME to the home directory of the user who initiated the command.

  1. Starting in the Background:

  • When using commands through SSH, keep in mind that the backup-daemon-start.sh script runs in the foreground and stops when the SSH session closes.

  • To prevent this, use the backup-daemon-start-background.sh file to run the script in the background, ensuring it continues even after SSH is closed.

  1. Starting at System Boot via rc.local:

To initiate Zmanda Pro during system boot, modify the rc.local file.

  • Locate the rc.local file based on your system type:

For Debian or Ubuntu system: /etc/rc.local

For CentOS/RHEL: /etc/rc.d/rc.local

  • Add the following line to the rc.local file:

/opt/ZmandaPro/backup-daemon-start.sh &
  • If the rc.local file contains an exit 0 statement, ensure that any commands you wish to run during startup are added above that line. If you add commands below exit 0, they won't execute because the file has already stopped running.

  • On CentOS 7, make the rc.local file executable with: chmod +xon the rc.local file.

  1. Using rc.d

To enable Zmanda Pro at system boot, add a new file to the rc.d directory. Follow these steps:

  • Locate the rc.d directory on your system, typically found at /usr/local/etc/rc.d for Synology DSM 6.1+.

  • Create a new file with the following contents:

#!/bin/bash
/opt/ZmandaPro/backup-daemon-start-background.sh
  • Make the file executable using the command: chmod +x /usr/local/etc/rc.d/my-script.sh

  1. Using cron

Make Zmanda Pro start at system boot by adding an entry to root's crontab. Here's how:

  • Launch the crontab editor for root using the command: crontab -e -u root

  • Add entry @reboot /opt/ZmandaPro/backup-daemon-start-background.sh

  1. Using systemd

Use the provided unit file as a basic example to start the Zmanda Pro service during system boot.

[Unit]
Description=Zmanda Pro Backup Client
After=network-online.target

[Service]
Type=simple
RemainAfterExit=true
KillMode=process
User=root
ExecStart=/opt/ZmandaPro/backup-daemon-start.sh

[Install]
WantedBy=multi-user.target

Note: The provided unit file successfully starts the Zmanda Pro service. However, it's essential to note that there are certain limitations in systemd related to Zmanda Pro's multi-process model.

  1. Autostart for Graphical Desktop Application

For other distribution packages, if the graphical application doesn't auto-configure during desktop login, you can add the following autostart command to your desktop environment's settings.

backup-interface --background

Last updated