[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Running a program at system startup



Create a script in /etc/init.d and make a symbolic link to it in the rc 
runlevel directory that corresponds to your runlevel (or whatever runlevel 
you want the script to run).

For example, the /etc/init.d/foo.sh may be:
#!/bin/bash
cd /foo
/foo/make_something.sh

If you want this script to run in runlevel 2, then you can:
ln -s /etc/init.d/foo.sh /etc/rc2.d/S99foo

In the other hand, at any moment you can now the runlevel in what you are just 
typing:
who -r

Have a look at /etc/init.d scripts, they are self explanatory.
Also, have a look at "man init"

Regards

On Monday 20 August 2007 21:00, ArcticFox wrote:
> Here's the situation; I have a program that needs to run at system
> startup, but there are a few issues with that. First, it must be run
> with a certain directory as the working directory. Second it must be
> run as the user 'Fox'
>
> The information I've been able to find would end up with the program
> running as root and not from the right directory. I'm used to Macs and
> have no idea what I'm doing here, but I'm learning!
>
> Thanks.



Reply to: