LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   automating standard commands at boot time (https://www.linuxquestions.org/questions/linux-software-2/automating-standard-commands-at-boot-time-610570/)

Person_1873 01-02-2008 07:11 AM

automating standard commands at boot time
 
i have a system with 256MB RAM, i installed FC6 on it and it doesnt boot into a GUI, Gnome runs if you type startx, it also has an atheros wireless card which isn't recignised by the network manager so i have to type dhclient to access the net, is there any way to make these commands happen automatically on boot before you login? if so i would replace starx with gdm and login graphically i just find it annoying to have to write in these two commands every time i boot that system

jtshaw 01-02-2008 07:17 AM

If you look at /etc/inittab what is the default runlevel?

You should see something like this in the file: "id:5:initdefault:". That line would indicate that the default runlevel is level 5.

For RedHat/Fedora the default run levels are the following:

0 - halt (Do NOT set initdefault to this)
1 - Single user mode
2 - Multiuser, without NFS (The same as 3, if you do not have networking)
3 - Full multiuser mode (likely what your set to know... starts everything but x)
4 - unused
5 - X11 (What you want if you want graphical login and X started automatically)
6 - reboot (Do NOT set initdefault to this)

reddazz 01-02-2008 07:21 AM

To boot into a GUI by default, edit /etc/inittab and change
Code:

id:3:initdefault:
to
Code:

id:5:initdefault:
As for dhclient, you can add the command to /etc/rc.d/rc.local and it will be run at boot time.

jtshaw 01-02-2008 07:43 AM

Quote:

Originally Posted by reddazz (Post 3008457)
As for dhclient, you can add the command to /etc/rc.d/rc.local and it will be run at boot time.

You may want to look into /etc/sysconfig/network-scripts/ifcfg-ethX (where X is the correct number for the device. If you set BOOTPROTO=dhcp and ONBOOT=yes then you should get the desired effect of dhcp on bootup.

Person_1873 01-02-2008 07:49 AM

the device is ath0, why can't i just tell it to run dhclient?

Person_1873 01-02-2008 07:53 AM

could i just add gdm and dhclient to /etc/rc.d/rc.local ?

jtshaw 01-02-2008 07:55 AM

Is there an /etc/sysconfig/network-scripts/ifcfg-ath0 file? If not, create one that looks like this:

Code:

DEVICE=ath0
ONBOOT=yes
BOOTPROTO=dhcp

That is the "redhat way" of configuring network devices and will cause it to run dhclient on boot.

The /etc/sysconfig/network-scripts files are the files used by the RedHat network service script.

Person_1873 01-02-2008 08:10 AM

i'll look into all those options, i don't have access to the system currently, it's my dads n he gets a bit iffy with me changing things :P i have no idea why (3 burnt out P4 chips :S)

Person_1873 01-02-2008 08:13 AM

thankyou all for your suggestions, i'll look into all of them, i don't currently have access to the system as it's my dads, he gets a bit iffy with me changing things :P i have no idea why... i only burnt out 3 P4 chips :S


All times are GMT -5. The time now is 10:23 PM.