How to run a some binary file as soon as system boots up
Hi,
I need to automate of running a some binary file (some application) as soon as system boots up . How to do this ..? regards Bala |
Which distro? Different distros have different init methods. What type of application? GUI apps will require X to be up and running and will have a different method for autostarting than a command line app. For a gui app, also list which DE; different DEs like kde or gnome have there own methods for autostarting graphical apps on startup. For a command line app, state whether it needs to be executed as root or an ordinary user.
|
If you want to run command line application such as bash script,you can write `su <username> -c <app_path>` in /etc/rc.local file above `exit 0`.
After you must make to executable the script. |
Quote:
|
The folders in /etc should be /etc/init.d and /etc/rc.d .
Files of importance are also /sbin/init which calls the kernel first after mounting the rootfs/partition . This can be a link to '/bin/busybox init' or a binary . It is possible to rename /sbin/init to /sbin/init.bin and make a #!/bin/sh -script in which you could run what you want and at the end run 'exec /sbin/init.bin' , which runs (sources) /etc/inittab which further runs mostly files in /etc/rc.d/* , 'busybox init' especially rc.sysinit , in which everything of importance gets mounted (proc,sysfs) , other files of rc.d or init.d run , drivers loaded , and so on . You should have a look there . Files named rc.0 or rc.5 indicate the runlevel , something , that Puppy Linux does not know much about , but larger distros have such files . rc.S would be a 'single user mode' ^configuration file^ . man init : http://unixhelp.ed.ac.uk/CGI/man-cgi?init+8 and a good explanation found here : http://www.comptechdoc.org/os/linux/...man/index.html |
you can add @reboot /path/to/program in your crontab.
|
Hi,
My distro is ubuntu 11.04 . yes I want to run the script that is start.sh . Here is the line which I have writtel to put in rc.local . su user1 -c /home/user1/start.sh . but this is still not working for me ..? |
If you want it when you log in, just go to "System -> Preferences -> Starup Applications" in Gnome.
|
Post your start.sh script. I assume you already tested the script and it executes without error when you manually run it after login. If the user is logging into gnome, dudeman's suggestion should work. You can also put:
/home/user1/start.sh at the end of user1's bashrc file and it should execute on login from a command line login. |
Quote:
|
All times are GMT -5. The time now is 02:19 AM. |