Results 1 to 7 of 7

Thread: Correct location for Shell Scripts running at start-up

  1. #1
    Senior Member Karibu's Avatar
    Join Date
    Feb 2012
    Location
    Kelowna, BC Canada
    Posts
    157

    Question Correct location for Shell Scripts running at start-up

    Hi, I have a quick Question:
    Which is the correct location to put a shell script in order to get it started at boot?

    I tried /etc/init.d but it didn't work.
    The script I want to start is lxdeDefaultScreenlayout for my dual monitor system, which was generated with 'exit
    arandr'.
    Last edited by Karibu; 09-10-2012 at 07:35 PM.

  2. #2
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    Greetings, Karibu.

    You might give /etc/rc.local a try.
    Things here apply after all other initialization is over, allegedly.

  3. #3
    Senior Member registered user
    Join Date
    Feb 2010
    Posts
    512
    Greetings, Karibu!

    The boot process of Knoppix consists of several steps like finding the Knoppix directory, building up of the union file system, detection of hardware components, starting the desktop environment. At all times there are means to run a shell script in addition to the usual ones delivered with Knoppix.

    If you want to start a service you would use the /etc/rc.local configuration file. If you need to run a script at the end of /etc/init.d/knoppix-autoconfig you can create a file knoppix.sh in the KNOPPIX directory. If you want to run a shell script after the setup of the desktop environment you can put that script in the directory /usr/local/bin and create a suitable .desktop file in the directory /home/knoppix/.config/autostart. Configuration files for the X server are usually put in a subdirectory of /etc/X11.

  4. #4
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    Greetings, Klaus2008.

    I'm going to frame Post #3 over my workplace.
    Thanks for that jewel.

  5. #5
    Senior Member Karibu's Avatar
    Join Date
    Feb 2012
    Location
    Kelowna, BC Canada
    Posts
    157
    Thank you Klaus for the Info... It is a bit to high for me...
    runing in the Terminal 'arandr' gives me a script which configures my two-monitor system.
    #!/bin/sh
    xrandr --output VGA-0 --mode 1920x1080 --pos 0x0 --rotate normal
    --output DVI-0 --mode 1920x1080 --pos 1920x0 --rotate normal
    I want this have executed automatically with each start/restart..
    I put the file in the locations
    - /home/knoppix/.config/autostart
    - /etc/X11/Xsession.d
    - /usr/local/bin
    but none worked. What do I have to do?

  6. #6
    Senior Member registered user
    Join Date
    Feb 2010
    Posts
    512
    I think that you should create a small file /home/knoppix/.config/autostart/lxdeDefaultScreenlayout.desktop with the following content:
    Code:
    [Desktop Entry]
    Name=lxdeDefaultScreenlayout
    Type=Application
    Exec=sudo /usr/local/bin/lxdeDefaultScreenlayout
    Terminal=false
    The owner of the .desktop file should be knoppix.

    There is a thread 'How to autorun a X program' where you can find a link to the 'Desktop Entry Specification'.

  7. #7
    Senior Member Karibu's Avatar
    Join Date
    Feb 2012
    Location
    Kelowna, BC Canada
    Posts
    157

    Thumbs up

    Issue SOLVED...
    It works as expected...
    Thank you Klaus for your outstanding support

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G picture

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G

$13.99



HyperX FURY RAM DDR4 16GB 8GB 32GB 4GB 3200 2666 2400 2133 Desktop Memory DIMM picture

HyperX FURY RAM DDR4 16GB 8GB 32GB 4GB 3200 2666 2400 2133 Desktop Memory DIMM

$9.64



A-Tech 8GB PC3-12800 Desktop DDR3 1600 MHz Non ECC 240-Pin DIMM Memory RAM 1x 8G picture

A-Tech 8GB PC3-12800 Desktop DDR3 1600 MHz Non ECC 240-Pin DIMM Memory RAM 1x 8G

$13.99



CRUCIAL DDR3L 8GB 16GB 32GB 1600 MHz PC3-12800 Laptop Memory RAM SODIMM 204-Pin picture

CRUCIAL DDR3L 8GB 16GB 32GB 1600 MHz PC3-12800 Laptop Memory RAM SODIMM 204-Pin

$14.35



Team T-FORCE VULCAN Z 16GB (2 x 8GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) Intel picture

Team T-FORCE VULCAN Z 16GB (2 x 8GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) Intel

$35.99



A-Tech 16GB 2 x 8GB PC3-12800 Laptop SODIMM DDR3 1600 Memory RAM PC3L 16G DDR3L picture

A-Tech 16GB 2 x 8GB PC3-12800 Laptop SODIMM DDR3 1600 Memory RAM PC3L 16G DDR3L

$27.98



HMT84GL7AMR4C-RD 32GB DDR3 Server Memory RAM 14900L ECC REG 4Rx4 SK Hynix Cisco picture

HMT84GL7AMR4C-RD 32GB DDR3 Server Memory RAM 14900L ECC REG 4Rx4 SK Hynix Cisco

$13.99



A-Tech 16GB 2x 8GB PC3-12800 Desktop DDR3 1600 MHz 240pin DIMM Memory RAM 16G 8G picture

A-Tech 16GB 2x 8GB PC3-12800 Desktop DDR3 1600 MHz 240pin DIMM Memory RAM 16G 8G

$27.98



Hynix 64GB 4Rx4 PC4-2133P-L LRDIMM DDR4-17000 ECC Load Reduced Server Memory RAM picture

Hynix 64GB 4Rx4 PC4-2133P-L LRDIMM DDR4-17000 ECC Load Reduced Server Memory RAM

$64.99



A-Tech 32GB 2x 16GB PC4-25600 Laptop SODIMM DDR4 3200 MHz Non-ECC Memory RAM 32G picture

A-Tech 32GB 2x 16GB PC4-25600 Laptop SODIMM DDR4 3200 MHz Non-ECC Memory RAM 32G

$59.99