Run a script upon entering runlevel 2
Hello,
I'm booting Knoppix 6.7.1 from DOK.
The image on this media was created using a live CD.
Then I changed syslinux.cfg in 6.7.1 and now knoppix enters runlevel 2 (text mode) by default.
Upon entering this level I want to run my script.
So I added:
echo "My script"
in /etc/rc.local
But "My script" is not displayed.
According to another thread in this forum I tried putting my script in :
/opt/knx/knoppix/KNOPPIX/knoppix.sh
But this does not work also.
Can you help ?
Thanks,
Zvika.
Loading graphical applications with knoppix.sh
Challenge: A user wants knoppix.sh to launch, or cause to be launched, a Leafpad window on his display. The window should be waiting for him once his graphical desktop loads. What code will allow him to do so?
Trying to run Leafpad, or any graphical program, from the root console results, of course, in a "Cannot open display" warning. I thought this challenge should have an obvious solution - the consoles and x-server are not totally insulated from one another, since they can all access the same filesystem, so there must be a simple command that can tell the console to make the x-server perform a job (e.g. launch a window) remotely, as it were. But so far my research and attempts have not found this 'simple command', if it even exists.
What do you think about the possibility of this challenge?
Relatively inelegant and hard-wired, but it works
I have found no universal way to do it, and several of the solutions on the net don't work with Knoppix/LXDE.
But, if you run LXDE, there is a relatively inelegant&hard-wired solution, documented on the LXDE Wiki: http://wiki.lxde.org/en/Autostart
Edit the file /etc/xdg/lxsession/LXDE/autostart and add the things you want to have run, prepended with an "@", like @leafpad, and add parameters as needed.
Then it worked for me, at least. Attempts at using only the user's .desktop file didn't succeed for me.
Thank you for the question, I'll need this myself to get virtualization set up automatically. :)