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
SERVICE(8)						      System Manager's Manual							SERVICE(8)

NAME
service - run a System V init script SYNOPSIS
service SCRIPT COMMAND [OPTIONS] service --status-all service --help | -h | --version DESCRIPTION
service runs a System V init script or systemd unit in as predictable an environment as possible, removing most environment variables and with the current working directory set to /. The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT, or the name of a systemd unit. The existence of a systemd unit of the same name as a script in /etc/init.d will cause the unit to take precedence over the init.d script. The supported val- ues of COMMAND depend on the invoked script. service passes COMMAND and OPTIONS to the init script unmodified. For systemd units, start, stop, status, and reload are passed through to their systemctl/initctl equivalents. All scripts should support at least the start and stop commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start command. service --status-all runs all init scripts, in alphabetical order, with the status command. The status is [ + ] for running services, [ - ] for stopped services and [ ? ] for services without a status command. This option only calls status for sysvinit jobs. EXIT CODES
service calls the init script and returns the status returned by it. FILES
/etc/init.d The directory containing System V init scripts. /{lib,run,etc}/systemd/system The directories containing systemd units. ENVIRONMENT
LANG, LANGUAGE, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEA- SUREMENT, LC_IDENTIFICATION, LC_ALL, TERM, PATH The only environment variables passed to the init scripts. SEE ALSO
/etc/init.d/skeleton update-rc.d(8) init(8) invoke-rc.d(8) systemctl(1) AUTHOR
Miloslav Trmac <mitr@redhat.com>, Petter Reinholdtsen <pere@hungry.com> Licence: GNU Public Licence v2 (GPLv2) COPYRIGHT
2006 Red Hat, Inc., Petter Reinholdtsen <pere@hungry.com> Jan 206 SERVICE(8)
All times are GMT -4. The time now is 12:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy