Find the answer to your Linux question:
Results 1 to 4 of 4
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 ...
  1. #1
    Just Joined!
    Join Date
    Mar 2007
    Posts
    20

    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? Thanks!

    The following is the settings:

    - cat /etc/init.d/rc3.local:
    #! /bin/sh
    #touch /tmp/test.txt

    - cat /etc/init.d/rc5.local:
    #! /bin/sh
    #touch /tmp/test.txt


    - 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

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    It seems that you've comment out the touch commands in your scripts.

    Regards

  3. #3
    Just Joined!
    Join Date
    Mar 2007
    Posts
    20
    Sorry, that's a typo. There's no comment sign # before the command
    touch /tmp/test.txt

    And 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 just looked into the /etc/init.d again and found the following two files: "boot.local" and "skeleton". Are they for customizing any startup script?

  4. #4
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    Well, I'm not familiar with opensuse but this is a useful link how to do it:

    SDB:How to Create Your Own Init Script - openSUSE

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...