Quote:
Originally Posted by natm
well, there's /etc/rc.local, I'd assume that that is it, but your comment about using su confused me. could you elaborate?
I thought that su made it so you were the superuser, instead of taking root privileges away from you.
|
Yes,
/etc/rc.local is the file. On my first post I had neglected to notice that you list Ubuntu as your distro.
su is frequently used to acquire superuser privileges, but it can, in fact, make you any user. When a user is not specified,
su defaults to
root, and you will usually have to supply root's password. If you are
already root, then you can become, or execute commands as any user w/o specifying a password. For example, here is a line from one of the scripts in my /etc/cron.daily directory.
Code:
[ -x $arch_script ] && su -c "nice -2 $arch_script" jim
The variable
arch_script has been set to a script I want to run daily as user "jim". Everything in this directory will be run once a day as the superuser. So this line first tests and makes sure $arch_script exists and is executable, (although it doesn't actually test to make sure it is executable by
jim ). If so, then it executes the script with a "niceness" of 2 as user "jim".