Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 23rd November 2005, 04:35 AM
cancerian80 Offline
Registered User
 
Join Date: Nov 2005
Posts: 6
startup script

hi,
i am trying to add a script to startup, to fix laptop resolution using 855resolution patch. I made sh file with command "855resolution 7e 1280 800", changed permissions to 777, and put it in /etc/rc.d/init.d.

But it still doesnt start during startup, so i made a shortcut to it called "S05startup.sh and put it in /etc/rd2.d. but its still not working. Please help.
Reply With Quote
  #2  
Old 16th December 2005, 03:37 AM
nemesys's Avatar
nemesys Offline
Registered User
 
Join Date: Nov 2005
Posts: 25
SOMEBODY please answer this guy's question!!!!!!

I have the very same question!!!!!

Hey cancerian80, if you found your answer somewhere else, please postit here.
Reply With Quote
  #3  
Old 16th December 2005, 04:00 AM
IronWolf Offline
Registered User
 
Join Date: Dec 2005
Posts: 198
Add this to /etc/rc.d/rc.local

Code:
if [ `runlevel | cut -f2 -d' '` -eq 5 ]; then
#runscript
855resolution 7d 1280 800
fi
This will check the run level and if it is runlevel 5 will run the patch.
Reply With Quote
  #4  
Old 16th December 2005, 04:00 AM
mbokil's Avatar
mbokil Offline
Registered User
 
Join Date: Nov 2004
Location: Boston
Posts: 503
startup scripts for kde, gnome, xfce4

Possibly that script has to run after X Window starts up. If you are using Gnome you can add a script to run when gnome loads by:

Using Gnome session manager. Select Applications (the Footer menu) -> Desktop Preferences -> Advanced -> Sessions and hit the Startup Programs tab. Click Add and browse to where you saved the above script and select it. Click OK. Hit the Current Sessions tab and click Apply.

If you are using something like XFCE4 then you put your startup scripts in the "Autostart" Folder which sits inside the desktop folder.

For KDE it is ~/.kde/Autostart/
The file should be set to execute and if it is a shell script place the text
Code:
#!/bin/bash
at the top
__________________
Fedora 9 / XFCE 4.4.2
Athlon Thunderbird CPU 1.3 GigHz
750 MB RAM
Nvidia Gforce 6200
Mozilla Seamonkey 1.1.9 browser with MonkeyMenu Extension

Last edited by mbokil; 16th December 2005 at 04:07 AM.
Reply With Quote
  #5  
Old 16th December 2005, 10:41 AM
giulix's Avatar
giulix Offline
"Fixed" by (vague) request
 
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950
To load a script at startup in Fedora, use the following procedure:
.Write your startup script, test it throughly and put it into /etc/rc.d/init.d
.At the top of the file, add the lines specified in the chkconfig man page (see RUNLEVEL FILES section)
.Add the script symlinks to the various rc?.d directories
Code:
/sbin/chkconfig --add scriptname
Run the above as root. This way, you'll be able to use 'service servicename start|stop|status' (provided you wrote the code to manage start|stop|status) and also to use the service graphical interface (Desktop->System Settings->Server Settings->Services).

hth...

Last edited by giulix; 16th December 2005 at 10:48 AM.
Reply With Quote
  #6  
Old 18th December 2005, 01:01 AM
cancerian80 Offline
Registered User
 
Join Date: Nov 2005
Posts: 6
this is what i did...

1)Make the following script, call it watever want, lets say ResFix

#!/bin/bash
# chkconfig: 5 5 5
# description: change resolution mode

855resolution 7e 1280 800

2) Put it in /etc/init.d

3) Type the following commands at terminal
chkconfig --add ResFix
chkconfig ResFix on

I am starting it at runlevel 5, works fine, although for shutdown, u might want to try a different level, I just use the same, cause I was using ubuntu before. But this works fine.
Reply With Quote
  #7  
Old 18th December 2005, 05:56 AM
nemesys's Avatar
nemesys Offline
Registered User
 
Join Date: Nov 2005
Posts: 25
Question

This is the famous script I've been talking about:
Code:
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING -out-interface ppp0 -j MASQUERADE
iptables --append FORWARD -in-interface eth0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
As you can see is very simple. I'll add some more security later but this is what get's me online by now.
Ok, how do I make this an executable script and make it run at the startup? I'm asking one more time because the answers given by now are ment (it seems) for more serious stuff.

Thanks for your attention!
Reply With Quote
  #8  
Old 18th December 2005, 12:56 PM
cancerian80 Offline
Registered User
 
Join Date: Nov 2005
Posts: 6
To make a script run during startup, you need to

1) Make a script, lets say "startupscript" where you need to specify in which run level the scipt runs
(0-6), its start and stop priority. For example the following script runs in runlevel 2,3,4,5, its start priroty is 10, stop priority is 12, and then executes the commands:

#!/bin/bash
# chkconfig: 2345 10 11
# description: activate network interface

ifconfig eth0 192.168.1.11 netmask 255.255.255.0

2) Move it to /etc/init.d

mv startupscript /etc/init.d

3) Change permissions on it, make it executable

chmod 777

4) Use chkconfig to add it to services

chkconfig --add startupscript

5) Turn the scrip on

chkconfig startupscript on

6)You can verify if the script is now added to services by following command

chkconfig --list

That should be it.

Hope this helps.
Reply With Quote
  #9  
Old 18th December 2005, 01:19 PM
IronWolf Offline
Registered User
 
Join Date: Dec 2005
Posts: 198
Quote:
Originally Posted by cancerian80
3) Change permissions on it, make it executable

chmod 777
Executable, not world writeable as well. These permissions would let any user on the sytem add commands to it that will get run during the start up of the system. Scripts in init.d should be:

chmod 755
Reply With Quote
  #10  
Old 19th December 2005, 04:27 AM
nemesys's Avatar
nemesys Offline
Registered User
 
Join Date: Nov 2005
Posts: 25
GOOD! Finally an answer I can use. Thanks a lot cancerian - and IronWolf for you security advise!
Reply With Quote
  #11  
Old 24th July 2007, 02:42 AM
type568's Avatar
type568 Offline
Registered User
 
Join Date: Jul 2007
Posts: 90
Hello, I'm pretty new to Linux < a week. And I've two questions which are at my opinion related to the subject.

1. I had a big problem with my Nvidia driver, it even caused me to reinstall the system. But I still live without one. When I get it on, I'm having limited resolution to 640 x 480 (On an Asus N-6600!), and I can't change it. Maybe I can just use some command to do so? If so, what would it be, and where can I write it. (obviously terminal, but then full command please) Ah, and perhaps I will also need to add this script to startup..

2. I want to simply put some program to my auto start.. without any special properties for now(well, it would be nice if Firefox opens my homepage, on full screen in last desktop, but I guess it's hard), what I want is simply to start Internet Messenger, because I have to manually start it every time.

Thanks.
__________________
-= Life Sux =-
Reply With Quote
  #12  
Old 24th July 2007, 04:56 PM
stitch626 Offline
Registered User
 
Join Date: Jul 2007
Location: Minsk, Belarus
Posts: 6
Quote:
Originally Posted by type568
Hello, I'm pretty new to Linux < a week. And I've two questions which are at my opinion related to the subject.

1. I had a big problem with my Nvidia driver, it even caused me to reinstall the system. But I still live without one. When I get it on, I'm having limited resolution to 640 x 480 (On an Asus N-6600!), and I can't change it. Maybe I can just use some command to do so? If so, what would it be, and where can I write it. (obviously terminal, but then full command please) Ah, and perhaps I will also need to add this script to startup..

2. I want to simply put some program to my auto start.. without any special properties for now(well, it would be nice if Firefox opens my homepage, on full screen in last desktop, but I guess it's hard), what I want is simply to start Internet Messenger, because I have to manually start it every time.

Thanks.
1. Most likely you should fix your xorg.conf. Run in terminal and paste here
Code:
cat /etc/X11/xorg.conf
2. Open System > Preferences > Personal > Sessions
Then in 'Start up' tab add any program you need
Reply With Quote
  #13  
Old 25th July 2007, 02:37 AM
type568's Avatar
type568 Offline
Registered User
 
Join Date: Jul 2007
Posts: 90
My xorg.. I wish it would be so easy.

Code:
# Xorg configuration created by system-config-display

Section "ServerLayout"
        Identifier     "single head configuration"
        Screen      0  "Screen0" 0 0
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
EndSection

Section "Device"
        Identifier  "Videocard0"
        Driver      "nv"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes "1280x1024" "1280x960"
        EndSubSection
EndSection
Thanks a lot about startup. XD

Edit: The Modes "1280x1024" "1280x960" - I added manually, of course it didn't help.
__________________
-= Life Sux =-
Reply With Quote
  #14  
Old 25th July 2007, 06:58 AM
stitch626 Offline
Registered User
 
Join Date: Jul 2007
Location: Minsk, Belarus
Posts: 6
Sory, I have never had any difficulties with Nvidia driver. Yesterday, I installed ATI driver using tips from here http://news.softpedia.com/news/How-t...-7-59919.shtml It's tip for Nvidia there, I hope It will help you too

Also you didn't provide any info how did you install drivers, had you any error.
Reply With Quote
  #15  
Old 26th July 2007, 02:28 AM
type568's Avatar
type568 Offline
Registered User
 
Join Date: Jul 2007
Posts: 90
No, I did not.
__________________
-= Life Sux =-
Reply With Quote
Reply

Tags
script, startup

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
smb startup script crab_com Using Fedora 0 18th February 2009 04:47 AM
startup script? shafted Using Fedora 1 10th December 2007 12:50 AM
How can I set startup-script? youhaodeyi Using Fedora 2 22nd October 2007 07:43 AM
How to run a script on startup nemesys Using Fedora 0 19th November 2005 04:31 PM
startup script jyrppa Using Fedora 2 7th March 2005 02:00 PM


Current GMT-time: 16:05 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat