In Linux Mint 9 Isadora which is based off the Ubuntu Lucid build 10.04. These commands should be good for most versions as well. If the file exists, your solid;P
To run a command during start up sequence; place a file in init.d near the alphabetical end. or perhaps hijack this file
To run a command at start up, as root, just before anyone logs in
I use this command to run synergy. In this way both login screens can be controlled by one keyboard/mouse even before either computer logs in.
Code: Select all
export privilegedfile=/etc/rc.local
sudo sh -c "echo '#!/bin/sh -e' > $privilegedfile"
sudo sh -c "echo '# rc.local' >> $privilegedfile"
sudo sh -c "echo '# By default this script does nothing' >> $privilegedfile"
sudo sh -c "echo 'export JRE_HOME=/usr/lib/jvm/java-6-sun-1.6.0.20' >> $privilegedfile"
sudo sh -c "echo '/usr/local/tomcat/bin/startup.sh' >> $privilegedfile"
sudo sh -c "echo 'synergys --config /etc/synergy.conf' >> $privilegedfile"
sudo sh -c "echo 'exit 0' >> $privilegedfile"
To run a command with environment variables seen by user. It is observed after viewing ~/.profile that bash_login is desired
Which I use as a place to store some frequency commands I use as environment variables
Code: Select all
echo "export tomcatdown='sudo /usr/local/tomcat/bin/shutdown.sh'" >> ~/.bash_login
echo "export tomcatup='sudo /usr/local/tomcat/bin/startup.sh'" >> ~/.bash_login
echo "export tomcat=/usr/local/tomcat/webapps" >> ~/.bash_login