--- title: "Install binaries on Nodegrid OS" slug: "install-binaries-on-nodegrid-os" tags: ["Install pre-compiled binaries"] updated: 2023-05-22T18:08:46Z published: 2023-05-22T18:08:46Z canonical: "docs.zpesystems.com/install-binaries-on-nodegrid-os" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.zpesystems.com/llms.txt > Use this file to discover all available pages before exploring further. # Install binaries on Nodegrid OS ## Install pre-compiled binaries on Nodegrid OS From time to time, customers have the requirement to expand Nodegrid OS build-in capabilities. Customers have two options to archive this goal. - Run the additional software in a hypervisor environment, either **docker** (Recommended) or full VM - Install pre-compiled linux binaries; this is only supported in some instances as Nodegrid does not offer a Linux package manager, and the software which should be installed must be fully self-contained. Examples that can be installed through this method are: - [Splunk agent](https://docs.splunk.com/Documentation/Splunk/9.0.4/Installation/InstallonLinux) - [Influx DB kapacitor daemon](https://docs.influxdata.com/kapacitor/v1.6/introduction/installation/) - [docker-compose](https://docs.docker.com/desktop/install/linux-install/) > Note: The recommended method to install additional software on a Nodegrid appliance is through the use of `docker` containers. This capability is available on all appliances. This guide covers at a high level how customers can install and run pre-compiled Linux application on Nodegrid appliances and answer some of the most common questions. Nodegrid OS implements it's own Linux library which is related on the Debian LTS versions. Applications which are designed for Debian/Ubuntu distributions and dont require external dependencies maybe able to run on Nodegrid OS. Depending on the use case, customers can install software binaries as part of a specific user or for global installation as root user. However, this guide assumes the packages will be installed by the default **admin** account as ***root*** user. The following table outlines the most common details, which are | Setting | Value | Commands | Comments | | --- | --- | --- | --- | | install root directory | /var/opt/ | | | | install directory | /var/opt/ | `mkdir /var/opt/<PACKAGE>` | | | start at boot up | init.d script | `vi /etc/init.d/<SERVICENAME>` | see [below](/guides/docs/install-binaries-on-nodegrid-os#adding-initd-startstopstatus-script-to-system-start-up) for example script and setup | | system path | create symlink | `ln -s /var/opt/<PACKAGE> /usr/bin/<PACKAGE>` | see [below](/guides/docs/install-binaries-on-nodegrid-os#create-symlink-to-add-binary-to-path) for example script and setup | ### Create init.d start-up script - create an init.d start/stop script with ``` vi /etc/init.d/ ``` - File content, adjust the required sections ``` #!/bin/bash ### BEGIN INIT INFO # Provides: myservice # Required-Start: $remote_fs $network # Required-Stop: $remote_fs $network # Default-Start: 5 # Default-Stop: 0 1 6 # Short-Description: My Service # Description: This is an example init.d script for My Service. # Update the section start()/stop()/status() as needed ### END INIT INFO # Path to the service executable SERVICE_PATH="/var/opt/" SERVICE_NAME="My Service" # Command to start the service start() { if [ -f "$SERVICE_PATH" ]; then echo "Starting $SERVICE_NAME..." "$SERVICE_PATH" > /dev/null 2>&1 & else echo "Service executable not found: $SERVICE_PATH" fi } # Command to stop the service stop() { echo "Stopping $SERVICE_NAME..." pkill -f "$SERVICE_PATH" } # Command to check the status of the service status() { if pgrep -f "$SERVICE_PATH" >/dev/null; then echo "$SERVICE_NAME is running." else echo "$SERVICE_NAME is not running." fi } # Handle command-line arguments case "$1" in start) start ;; stop) stop ;; restart) stop sleep 1 start ;; status) status ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac exit 0 ``` ### Adding init.d start/stop/status script to system start-up ``` update-rc.d defaults ``` ### Updating the users PATH variable to include the new application. This must be executed for each user who requires access to the application. Update the setting **** as needed ``` new_path="/var/opt/" if [[ ":$PATH:" == *":$new_path:"* ]]; then echo "The new path is already in the PATH variable." else echo "export PATH=\"$new_path:\$PATH\"" >> ~/.bashrc export PATH="$new_path:$PATH" echo "The PATH variable has been updated." fi ```