LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Ways to load or run an excutable at start up, advantages and drawbacks, etc. (https://www.linuxquestions.org/questions/linux-newbie-8/ways-to-load-or-run-an-excutable-at-start-up-advantages-and-drawbacks-etc-621119/)

lumix 02-14-2008 12:18 PM

Ways to load or run an excutable at start up, advantages and drawbacks, etc.
 
If I've created a script that I'd like to run every time Linux boots, what are the options for doing so, and the implications (advantages, drawbacks, caveats, etc) of the given method?

Also, if I want it start up as a , um, service?, er background process, hmm...what do you call it when the system runs an app like apache that is user independent and in the background? Well, that's how I'd like to run the script.

Assume Debian feisty, I suppose.

knudfl 02-14-2008 12:59 PM

Have a look at /etc/profile.d
That might be the right place for your script.

lumix 02-14-2008 01:16 PM

No profile.d in there, but a "profile" with very little in it:

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
fi

if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi

export PATH

umask 022


All times are GMT -5. The time now is 01:36 AM.