Sponsored Content
Operating Systems Linux Fedora Xrandr on startup - Fedora 19, VMWare Fusion Post 302900125 by bakunin on Sunday 4th of May 2014 09:25:42 PM
Old 05-04-2014
Quote:
Originally Posted by jaykayen
I've tried placing the following script in /etc/init.d/ :

Code:
#!/bin/sh
exec /usr/bin/xrandr --output Virtual1 --mode 1680x1050 --rate 60

but this doesn't do anything. The file is named "screenres" and has permissions "-rwxr-xr-x".
The problem is: nobody tells anybody to run that script at startup. I suggest you read the manpages of regarding "runlevels" and "init" to get a better understanding about how the startup process of a *ix-system works (notice that there are 2 fundamental layouts, "SysV" and "BSD").

To solve your problem: put (a link to) the script into "/etc/rcN.d", and name it Snn where "nn" is a two-digit number and "N" is the number of the runlevel whichs start you want to trigger the script. Or you can write a configuration file for init and place it in "/etc/init.d". Read the man page for init(5) to find out which format this has to be.

With Fedora/CentOS/RedHat you can also use the "chkconfig" utility to automatically place start/stop-scripts for arbitrary services into the various rc-directories. In this case you would have to change your script to accept "start", "stop" and "status" as parameters and create a pseudo-service from it.

I hope this helps.

bakunin

Last edited by bakunin; 05-04-2014 at 10:32 PM..
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fusion de 2 fichiers

Bonjour, je souhaiterais un script bash fusionnant 2 fichiers tout en virant les doublons. Exemple : fic1 : toto titi fic2 : toto tata Résultat souhaité, fic 3 : toto titi tata Merci. (1 Reply)
Discussion started by: Celmar
1 Replies

2. Red Hat

fedora grub help, moving to tri boot (XP, ubuntu, fedora soemething)

I will shortly be adding a fedora flavor to my devel box. I currently have XP (installed first on an ssd), ubuntu 10.04 (installed second on the first partition of a platter drive), and I want to add either Cent or SL on the second partition of the platter drive. I will probably also want to... (0 Replies)
Discussion started by: LMHmedchem
0 Replies

3. Ubuntu

VMware crash on startup

Hi all This is kind of urgent... please give any advice if possible. I'll try and explain it as simply as possible. As a new user of VMware, I was impressed with it. Until it decided to freeze every time I start it. I have an assessment due tomorrow, and I need to submit the files via... (1 Reply)
Discussion started by: qf_woodfox
1 Replies

4. Red Hat

Fedora startup script help

Can someone please tell me how to run a fedora startup script? I read these guides and tried to do what they said with no luck. Create a Startup Script Custom Startup Script | Open Source Club at Ohio State University This is what I put in my startup script. #!/bin/bash # chkconfig:... (6 Replies)
Discussion started by: cokedude
6 Replies

5. UNIX for Advanced & Expert Users

xrandr: cannot find crtc for output VGA1

If you get one of these two messages it means you either have a bad connection or you forgot to turn off the screen that you used last (the second one only happens in my experience when use multiple types of screens). xrandr: cannot find crtc for output VGA1 xrandr: cannot find crtc for output... (0 Replies)
Discussion started by: cokedude
0 Replies

6. UNIX for Advanced & Expert Users

xrandr imagining things

Why is my xrandr imagining things? I have disconnected VGA1 power. How is the VGA1 still coming up? $ xrandr Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096 LVDS1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 304mm x 228mm 1024x768 60.0*+ ... (2 Replies)
Discussion started by: cokedude
2 Replies

7. Linux

Fedora on VMware

I am trying to install Fedora 18 on a Windows system through VMware. When I power on the virtual machine I get messages that Fedora is starting, but the end result is just a screen with a graphic of a large blue box. No buttons to be found and input does nothing. I do have Knoppix running using the... (5 Replies)
Discussion started by: intranslation
5 Replies

8. Shell Programming and Scripting

Apache tomcat startup script not booting at startup.

I copied the script from an AskUbuntu post - #!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT INFO ... (14 Replies)
Discussion started by: Hijanoqu
14 Replies
CHKCONFIG(8)						      System Manager's Manual						      CHKCONFIG(8)

NAME
chkconfig - updates and queries runlevel information for system services SYNOPSIS
chkconfig --list [name] chkconfig --add name chkconfig --del name chkconfig [--level levels] name <on|off|reset> chkconfig [--level levels] name DESCRIPTION
chkconfig provides a simple command-line tool for maintaining the /etc/rc[0-6].d directory hierarchy by relieving system administrators of the task of directly manipulating the numerous symbolic links in those directories. This implementation of chkconfig was inspired by the chkconfig command present in the IRIX operating system. Rather than maintaining con- figuration information outside of the /etc/rc[0-6].d hierarchy, however, this version directly manages the symlinks in /etc/rc[0-6].d. This leaves all of the configuration information regarding what services init starts in a single location. chkconfig has five distinct functions: adding new services for management, removing services from management, listing the current startup information for services, changing the startup information for services, and checking the startup state of a particular service. When chkconfig is run without any options, it displays usage information. If only a service name is given, it checks to see if the service is configured to be started in the current runlevel. If it is, chkconfig returns true; otherwise it returns false. The --level option may be used to have chkconfig query an alternative runlevel rather than the current one. If one of on, off, or reset is specified after the service name, chkconfig changes the startup information for the specified service. The on and off flags cause the service to be started or stopped, respectively, in the runlevels being changed. The reset flag resets the startup information for the service to whatever is specified in the init script in question. By default, the on and off options affect only runlevels 2, 3, 4, and 5, while reset affects all of the runlevels. The --level option may be used to specify which runlevels are affected. Note that for every service, each runlevel has either a start script or a stop script. When switching runlevels, init will not re-start an already-started service, and will not re-stop a service that is not running. OPTIONS
--level levels Specifies the run levels an operation should pertain to. It is given as a string of numbers from 0 to 7. For example, --level 35 specifies runlevels 3 and 5. --add name This option adds a new service for management by chkconfig. When a new service is added, chkconfig ensures that the service has either a start or a kill entry in every runlevel. If any runlevel is missing such an entry, chkconfig creates the appropriate entry as specified by the default values in the init script. Note that default entries in LSB-delimited 'INIT INFO' sections take prece- dence over the default runlevels in the initscript. --del name The service is removed from chkconfig management, and any symbolic links in /etc/rc[0-6].d which pertain to it are removed. --list name This option lists all of the services which chkconfig knows about, and whether they are stopped or started in each runlevel. If name is specified, information in only display about service name. RUNLEVEL FILES
Each service which should be manageable by chkconfig needs two or more commented lines added to its init.d script. The first line tells chkconfig what runlevels the service should be started in by default, as well as the start and stop priority levels. If the service should not, by default, be started in any runlevels, a - should be used in place of the runlevels list. The second line contains a description for the service, and may be extended across multiple lines with backslash continuation. For example, random.init has these three lines: # chkconfig: 2345 20 80 # description: Saves and restores system entropy pool for # higher quality random number generation. This says that the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and that its stop prior- ity should be 80. You should be able to figure out what the description says; the causes the line to be continued. The extra space in front of the line is ignored. SEE ALSO
init(8) ntsysv(8) serviceconf(8) AUTHOR
Erik Troan <ewt@redhat.com> 4th Berkeley Distribution Wed Oct 8 1997 CHKCONFIG(8)
All times are GMT -4. The time now is 05:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy