PDA

View Full Version : How can I have a command...


AndreL
08-12-2006, 05:09 AM
How can I have a command executed as root at boot time? (not a cron job)

danieldk
08-12-2006, 08:01 AM
How can I have a command executed as root at boot time? (not a cron job)

http://www.debian-administration.org/articles/28

AndreL
08-12-2006, 12:41 PM
That woudn't work because the command has to be isued after "X" is launched.
I'll have to use kde and put the command in a script in "autostart".

(I thought that there was an equivalent file to "autoexec.bat".)
Thanks.

bhobjj
08-14-2006, 05:29 PM
That woudn't work because the command has to be isued after "X" is launched.
I'll have to use kde and put the command in a script in "autostart".

(I thought that there was an equivalent file to "autoexec.bat".)
Thanks.

Maybe you could change gdm or kdm to 96 (instead of 99):
# update-rc.d gdm 96 2 3 4 5 . stop 96 0 1 6 .
And then have your script start after:
# update-rc.d yourscript start 98 2 3 4 5 . stop 98 0 1 6 .

AndreL
08-15-2006, 12:29 AM
Thanks, bhobjj, I may try that.

jjmac
09-01-2006, 06:19 AM
Yes, i was going to suggest an init script. Maybe 'local'

It sounds like it's agraphical boot, i just go into the console so i would be a bit rusty on kdm. But something similar to the following would likely apply.

Such as adding the command to ~/.xserverrc or ~/.xsession to execute it after X starts up, or your wm. Or possibly that could be done in ~/.xinitrc

As kdm has its' own hierarchy of startup files, i guess that would be the likely choice.


jm