Add a script to startup/init?
I use opensuse. I know "chkconfig" is a way to run some service when system inits at different levels. Now, I am thinking if it is ok to add a file "rc3.local" or "rc5.local" to /etc/init.d and then add link to either of them as "S99local" in /etc/init.d/rc3.d and in /etc/init.d/rc5.d respectively. So, I can add whatever program I want to run at startup to either rc3.local or rc5.local.
But this method fails to work. What is the problem? There is no problem in creating and writting files in the /tmp folder. If execute the rc3.local or rc5.local as root from command line, test.txt can be created as expected.
I also found the following two files in /etc/init.d: "boot.local" and "skeleton". Are they for customizing any startup script? Can anyone show an example? Thanks!
The following is the settings:
- cat /etc/init.d/rc3.local:
- cat /etc/init.d/rc5.local:
- ls -l /etc/init.d/rc3.local
-rwxr-xr-x root root ..../etc/init.d/rc3.local
- ls -l /etc/init.d/rc5.local
-rwxr-xr-x root root ..../etc/init.d/rc5.local
- ls -l /etc/init.d/rc3.d/S99local
lrwxr-xr-x root root ... /etc/init.d/rc3.d/S99local -> ../rc3.local
- lls -l /etc/init.d/rc5.d/S99local
lrwxr-xr-x root root ... /etc/init.d/rc5.d/S99local -> ../rc5.local