-
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
-
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.
-
Senior Member
registered user
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.
-
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
-
By sunburnt in forum Tips and Tricks
Replies: 5
Last Post: 05-28-2005, 05:39 PM
-
By helios17 in forum General Support
Replies: 1
Last Post: 10-01-2004, 06:53 AM
-
By pankajgadhari in forum General Support
Replies: 1
Last Post: 01-07-2004, 06:33 AM
-
By Pasq in forum Customising & Remastering
Replies: 1
Last Post: 05-22-2003, 10:50 PM
-
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
-
Forum Rules

SFP TO RJ45 TRANSCEIVER SFP MODULE COPPER SFP OPTICAL PORT TO RJ45 ETHERNET PORT
$7.99

NEW Sealed Cisco SFP-10G-LR 10GBASE-LR SFP+ 1310nm 10km *US Shipping*
$24.00

Dell Intel X710-DA2 5N7Y5 Dual-Port 10GbE SFP+ PCIe 3.0 x8 Network Adapter
$27.50

Intel SPTSLP2SLCDE 100G-DR1 QSFP28 500m 1311nm Transceivers - Lot of 10 - New
$200.00

Genuine Cisco SFP-10G-SR 0-2415-03 10 Gigabit Transceiver
$5.40

HP 560SFP+ 10GB 2-port PCIe NIC Ethernet ADAPTER 669279-001 w/ (2) 10GB SFP+
$16.99

Intel X520-DA2 10Gb 10Gbe 10 Gigabit Network Adapter NIC Dual Port E10G42BTDA
$28.94

(2) Cisco SFP-10G-SR-S 10G SR SFP+ Transceiver Modules 10-3105-01 - Genuine
$32.88

Cisco Acacia DP04QSDD-E25-840 400G QSFP-DD Coherent DCO Transceiver Module
$699.99

Cisco WS-C3650-12X48UR-L 48-Port Stackable Layer 3 8x10G SFP+ Port Switch
$129.99