Configuring the Data Gateway for Boot

The Data Gateway can be configured to boot automatically with its host at startup. The exact steps depend on the system you are using.

If you update the Data Gateway, make sure to update the executable reference in your startup configuration.

Linux

For a Linux system, you have several options depending on your specific distribution and preferences.

1. Using cron with @reboot

Cron is a time-based job scheduler in Unix-like operating systems. You can schedule the gateway to run at reboot by adding an entry to the crontab.

  1. Open the crontab configuration:

crontab -e
  1. Add a line in the following format:

@reboot /path/to/your/gateway

Replace /path/to/your/gateway with the path to the Data Gateway.

2. Using Systemd Services (Common in Modern Linux Distributions)

If your system uses systemd, you can create a custom service to run the gateway.

  1. Create a new service file in /etc/systemd/system, e.g., lumi_ai_data_gateway.service:

    sudo nano /etc/systemd/system/lumi_ai_data_gateway.service
  2. Add the following content to the service file:

    [Unit]
    Description=Lumi AI Data Gateway
    
    [Service]
    ExecStart=/path/to/your/gateway
    
    [Install]
    WantedBy=multi-user.target

    Replace /path/to/your/gateway with the path to your executable.

  3. Enable the service to start on boot:

    sudo systemctl enable lumi_ai_data_gateway.service
  4. Start the service immediately if you want to:

    sudo systemctl start lumi_ai_data_gateway.service

3. Using rc.local (For Older Systems or Specific Use Cases)

On older systems, or systems without systemd, you can use rc.local.

  1. Edit the rc.local file:

sudo nano /etc/rc.local
  1. Add the command to run the gateway before the exit 0 line:

/path/to/your/gateway
exit 0

Ensure that the gateway has executable permissions:

chmod +x /path/to/your/gateway

4. Using Desktop Environment Autostart (For GUI)

If you are using a Linux desktop environment, you can often add tasks to run at startup through the desktop environment's settings.

  • For GNOME, use gnome-session-properties.

  • For KDE, use the Autostart module in System Settings.

  • For other desktop environments, check their specific documentation.

Important Notes

  • Ensure that the gateway has execution permissions (chmod +x <data-gateway-filename>).

  • The choice of method depends on your specific Linux distribution and whether you are using a system with or without a GUI.

  • Always test your configuration to ensure that it behaves as expected on system startup.

Windows

For Windows, you can use the methods as described here:

1. Using Startup Folder

This is the simplest method and works well for a single account on the host.

For a Specific User:

  1. Press Win + R to open the Run dialog.

  2. Type shell:startup and press Enter. This opens the Startup folder for your user account.

  3. Place a shortcut to the gateway in this folder.

For All Users:

  1. Open the Run dialog (Win + R).

  2. Type shell:common startup and press Enter. This opens the common Startup folder.

  3. Place a shortcut to the gateway in this folder. (Note: You need administrative privileges for this action.)

2. Using Task Scheduler

Task Scheduler allows more control, like running a program at system startup with a delay or specific conditions.

  1. Open Task Scheduler (you can search for it in the Start menu).

  2. In the Actions pane, click "Create Basic Task..."

  3. Follow the wizard to name your task and choose the "When the computer starts" trigger.

  4. Select "Start a program" and browse to the gateway.

  5. Complete the wizard to create the task.

3. Using Group Policy Editor

For professional and enterprise versions of Windows, you can use Group Policy Editor.

  1. Make a bat file with start "" "C:\path\to\your\gateway.exe"

  2. Open Group Policy Editor (type gpedit.msc in the Run dialog).

  3. Navigate to User Configuration -> Windows Settings -> Scripts (Logon/Logoff) or Computer Configuration -> Windows Settings -> Scripts (Startup/Shutdown).

  4. Add the gateway here.

Important Notes

  • Always test your configuration to ensure that it behaves as expected on system startup.

Last updated