Results 1 to 4 of 4

Thread: Auto running scripts off a remastered CD question.

  1. #1
    Junior Member
    Join Date
    Nov 2003
    Posts
    1

    Auto running scripts off a remastered CD question.

    I'm running into a problem attempting to get a script to automatically run as user "knoppix". In essence this script must be run as the last thing before the end user gets to use the system (i.e. network needs to be up and running, the user directory need to set-up, X-Windows running, etc).

    In other words what I want is where do I put the line:

    /usr/local/bin/myscript

    or

    su - knoppix -c /usr/local/bin/myscript

    Yes, I have tested the script, if I pull up a terminal window as soon as the system starts and type "/usr/local/bin/myscript" the script will run fine, it is just a case where I don't want the end users to have have to be bothered typing the above (or read I don't want to have to teach them to do the above).

    I've been banging my head against a wall (on and off) on this one for a few weeks, help, and thanks in advance.

    C. McGregor

  2. #2
    Member registered user
    Join Date
    Sep 2003
    Posts
    67
    You will want to make this a startup script. This means to put it in one of the /etc/rc.d directories. I would suggest /etc/rc5.d. Make a file called SXXMyScript (where XX is the largest number inthe scheme) this will ensure that it is the last to be executed. This file should contain the script you want to run, i.e. the file will have one line.
    Code:
    /usr/local/bin/myscript
    Make sure that the file had execute permissions.

  3. #3
    Senior Member registered user
    Join Date
    Jun 2003
    Posts
    611
    I do it like this-

    su -c "/path/to/your/script" knoppix

    But there's no handy rc.local to stick it ins, so....

    You need to edit the contents of your script so that whatever it runs is su'd like above.

    Then,

    edit the default runcontrol to add the script by softlinking:

    example is /etc/rc5.d (for graphical mode boot)

    ln -s /usr/local/bin/myscript /etc/rc5.d/S99myscript


    The S99 part defines that this is something to start and 99 ensures it will be the last thing to start. However, as I mentioned, this is run as root. SO inside your script you may have to su -c knoppix as I mentioned above.

  4. #4
    Member registered user
    Join Date
    Sep 2003
    Posts
    80
    What you are looking for sounds more like something the login manager( kdm, gdm, xdm, etc ) would be handling but since Knoppix doesn't run that by default....would this work?

    /home/username/.kde/Autostart/Autorun.desktop

    It's how KDE is supposed to handle autostarting applications. You'd need to create the Autorun.desktop file with your script set as the executable. Then when the user starts KDE, your script gets run. Or atleast that's the idea.

Similar Threads

  1. Running commands & shell scripts automatically at boot
    By sunburnt in forum Tips and Tricks
    Replies: 5
    Last Post: 05-28-2005, 05:39 PM
  2. Replies: 1
    Last Post: 10-01-2004, 06:53 AM
  3. running scripts at startup when KNOPPIX boots
    By pankajgadhari in forum General Support
    Replies: 1
    Last Post: 01-07-2004, 06:33 AM
  4. Where are scripts with auto-detection ?
    By Pasq in forum Customising & Remastering
    Replies: 1
    Last Post: 05-22-2003, 10:50 PM
  5. Shell scripts running at Knoppix
    By majales in forum General Support
    Replies: 2
    Last Post: 05-15-2003, 04:21 PM

Posting Permissions

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


Dell 6P85J 4TB ST4000NM0063 7.2k 6Gb/s 3.5” SAS SED Hard Drive with Tray picture

Dell 6P85J 4TB ST4000NM0063 7.2k 6Gb/s 3.5” SAS SED Hard Drive with Tray

$39.99



Western Digital HUS726T4TAL5204 4TB 7.2K SAS 12Gb/s 3.5

Western Digital HUS726T4TAL5204 4TB 7.2K SAS 12Gb/s 3.5" 512e HDD NetApp X375A

$64.00



Seagate BarraCuda 28TB 7.2K SATA 6Gb/s 3.5in Internal HDD ST28000DM000 - Tested picture

Seagate BarraCuda 28TB 7.2K SATA 6Gb/s 3.5in Internal HDD ST28000DM000 - Tested

$670.00



DELL 2TB Enterprise HDD (7200RPM, 3.5

DELL 2TB Enterprise HDD (7200RPM, 3.5", SATA III, 128MB Cache) HUS722T2TALA600

$49.95



Seagate ST4000NM0034 Enterprise 4TB 7200RPM SAS 12Gb/s HDD v4 picture

Seagate ST4000NM0034 Enterprise 4TB 7200RPM SAS 12Gb/s HDD v4

$39.00



Seagate ST500DM009 BarraCuda 500 GB 3.5

Seagate ST500DM009 BarraCuda 500 GB 3.5" SATA III Desktop Hard Drive

$14.99



Dell ST6000NM0034 1HT27Z-150 NWCCG 6TB SAS 3.5 7.2K ENTERPRISE SERVER DRIVE picture

Dell ST6000NM0034 1HT27Z-150 NWCCG 6TB SAS 3.5 7.2K ENTERPRISE SERVER DRIVE

$68.99



HGST HUS724040ALA640 HDD 4TB SATA 6Gb/s 7.5K 3.5

HGST HUS724040ALA640 HDD 4TB SATA 6Gb/s 7.5K 3.5" 0F19459 512 b/s

$78.00



(ST8000NM0045) SEAGATE ENTERPRISE 8TB 7200RPM 4Kn SATA 6Gb/s 3.5

(ST8000NM0045) SEAGATE ENTERPRISE 8TB 7200RPM 4Kn SATA 6Gb/s 3.5" HARD DRIVE

$199.99



Seagate ST8000NM0075 Enterprise Capacity 3.5 HDD 8TB SAS Hard Drive 8TB EXOS picture

Seagate ST8000NM0075 Enterprise Capacity 3.5 HDD 8TB SAS Hard Drive 8TB EXOS

$184.99