In Slackware, how do I set environment variables at boot before the rc.local commands?
by cesarsj from LinuxQuestions.org on (#59H3K)
This script is in /etc/profile.d, because if I put everything in rc.local, the variables will no longer exist after logging in, I understand that.
Code:#!/bin/sh
export JAVA_HOME=/usr/lib64/java
export MANPATH="${MANPATH}:${JAVA_HOME}/man"
export PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
sudo /usr/local/sbin/zabbix_java/startup.sh
sudo /usr/local/sbin/zabbix_server
sudo /usr/local/sbin/zabbix_agentdHowever, I don't think it's the best idea to leave it in /etc/profile.d, because after logging in it will take a while before you can do anything. I believe it will be better at boot. As I need to load the java variables for the zabbix java gateway to work, does anyone have a better idea?


Code:#!/bin/sh
export JAVA_HOME=/usr/lib64/java
export MANPATH="${MANPATH}:${JAVA_HOME}/man"
export PATH="${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
sudo /usr/local/sbin/zabbix_java/startup.sh
sudo /usr/local/sbin/zabbix_server
sudo /usr/local/sbin/zabbix_agentdHowever, I don't think it's the best idea to leave it in /etc/profile.d, because after logging in it will take a while before you can do anything. I believe it will be better at boot. As I need to load the java variables for the zabbix java gateway to work, does anyone have a better idea?