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

23rd November 2005, 04:35 AM
|
|
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.
|

16th December 2005, 03:37 AM
|
 |
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.
|

16th December 2005, 04:00 AM
|
|
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.
|

16th December 2005, 04:00 AM
|
 |
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
at the top
Last edited by mbokil; 16th December 2005 at 04:07 AM.
|

16th December 2005, 10:41 AM
|
 |
"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.
|

18th December 2005, 01:01 AM
|
|
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.
|

18th December 2005, 05:56 AM
|
 |
Registered User
|
|
Join Date: Nov 2005
Posts: 25

|
|
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!
|

18th December 2005, 12:56 PM
|
|
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.
|

18th December 2005, 01:19 PM
|
|
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
|

19th December 2005, 04:27 AM
|
 |
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!
|

24th July 2007, 02:42 AM
|
 |
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 =-
|

24th July 2007, 04:56 PM
|
|
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
|

25th July 2007, 02:37 AM
|
 |
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 =-
|

25th July 2007, 06:58 AM
|
|
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.
|

26th July 2007, 02:28 AM
|
 |
Registered User
|
|
Join Date: Jul 2007
Posts: 90

|
|
|
No, I did not.
__________________
-= Life Sux =-
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 16:05 (Thursday, 23-05-2013)
|
|
 |
 |
 |
 |
|
|