There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display driver drivers email error excel explorer firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware network networking outlook outlook 2003 outlook express partition password printer problem ram router security slow software sound trojan usb video virus vista windows windows xp wireless
UNIX/Linux
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > UNIX/Linux >
Linux Startup


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
iOXeR's Avatar
Member with 96 posts.
 
Join Date: Jan 2005
Experience: Yes, please.
12-Jul-2005, 06:57 PM #1
Linux Startup
I've been using Linux for quite awhile now, but I've never actually had to do what I'm trying to do now. I want to run some commands at startup that I would normally run in the terminal after it has started up. Thanks in advance
tsunam's Avatar
Senior Member with 1,246 posts.
 
Join Date: Sep 2003
Experience: Linux~su
12-Jul-2005, 08:31 PM #2
what sort of commands are you trying to run?
Headrush's Avatar
Senior Member with 389 posts.
 
Join Date: Feb 2005
Experience: Advanced
13-Jul-2005, 01:24 AM #3
We need to know more about your system.

Are you running a GUI? Which one? If no, what shell are you using?
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
13-Jul-2005, 01:36 AM #4
What distro is this?
And how far along in the boot process do you want to run the command?
lynch's Avatar
Senior Member with 1,962 posts.
 
Join Date: Aug 2002
Location: Back East,Way Back East
13-Jul-2005, 05:08 AM #5
Look for a file named like one of the following:
  • etc/rc.d/rc.local
  • /etc/rc.d/boot.local
  • /etc/rc.local
Or similar; it could contain commented text like this:
Quote:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
Just add the commands there.
HTH
lynch
iOXeR's Avatar
Member with 96 posts.
 
Join Date: Jan 2005
Experience: Yes, please.
13-Jul-2005, 03:19 PM #6
I'm currently trying to mount an ntfs drive on startup. I downloaded the ntfs rpm from the Linux-NTFS Project website, installed it, and it works. Now instead of manually typing in the mount command after it has started up, I want it to do this automatically. I'm using Fedora Core 4, by the way.

Lynch, I found the file, but the command I want to run has to be run as root. Is there any way to do this? Would I be able to do this with su?
linuxphile's Avatar
Administrator with 379 posts.
 
Join Date: Mar 2003
Location: MD
Experience: Intermediate
13-Jul-2005, 03:31 PM #7
/etc/fstab
You don't need another script to mount an NTFS drive. You can add an entry into /etc/fstab along with the other mounts. See the man pages for fstab for the correct syntax.
iOXeR's Avatar
Member with 96 posts.
 
Join Date: Jan 2005
Experience: Yes, please.
13-Jul-2005, 03:52 PM #8
linuxphile, thanks! I got it working.

Just to know, how would I go about doing this using lynch's way? Not everything I'll want to run at startup in the future will be able to go into fstab.
linuxphile's Avatar
Administrator with 379 posts.
 
Join Date: Mar 2003
Location: MD
Experience: Intermediate
13-Jul-2005, 04:37 PM #9
I'm not entirely certain, although, I believe a script will run as root if root is it's owner.
AGCurry's Avatar
Senior Member with 431 posts.
 
Join Date: Jun 2005
Location: Kansas City area
Experience: advanced but learning
13-Jul-2005, 04:44 PM #10
Quote:
Originally Posted by linuxphile
I'm not entirely certain, although, I believe a script will run as root if root is it's owner.
No. It will run as whoever's trying to run it.
lynch's Avatar
Senior Member with 1,962 posts.
 
Join Date: Aug 2002
Location: Back East,Way Back East
13-Jul-2005, 05:33 PM #11
Quote:
Originally Posted by iOXeR
linuxphile, thanks! I got it working.

Just to know, how would I go about doing this using lynch's way? Not everything I'll want to run at startup in the future will be able to go into fstab.
I did'nt know you were trying to mount a drive at startup; linuxphile is right.
If you load commands in the file I suggested, you need to be root to enter anything in that file, so
it is being run by root.
lynch
codejockey's Avatar
Senior Member with 1,410 posts.
 
Join Date: Feb 2002
14-Jul-2005, 01:23 AM #12
My $0.02 worth (subject to rounding error and inflation ):

The owner of a file and the owner of a process running that file are generally not associated. For example, if my ID is codejockey, I can run files owned by root, subject to the permissions associated with the file (i.e., if only the file owner has execute permission, then only the owner and root will be able to execute the file -- I will not). If I can run the file, the process executes with my permissions (not the permissions of the owner of the file) -- with one exception: if the setuid bit of the permissions mask is set, then my invocation of the file will run with the permissions of the file owner, rather than with my permissions.

The setuid capability is a well-known security hole, and its use is discouraged unless there really is no other option. Shell scripts do not honor the setuid bit, even if set.

Hope this helps.
__________________
The slowest component still sits at the keyboard.
linuxphile's Avatar
Administrator with 379 posts.
 
Join Date: Mar 2003
Location: MD
Experience: Intermediate
14-Jul-2005, 10:40 AM #13
Thanks for the info codejockey. I wasn't clear on how the init process determines the user that a process runs as. I understood that in an interactive shell the user executing the script is the user the script runs as, unless, as you noted, the setuid bit is set.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:20 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.