Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Location
    SC
    Posts
    54

    run python script at startup


    What is the easiest way to run a python script at system startup in open solaris?

    I've tried the init.d, rcX.d directories but they only seem to run shell scripts.

  2. #2
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    are you invoking it with the python interpreter?

    e.g.

    Code:
    /usr/bin/python /path/to/script.py
    linux user # 503963

  3. #3
    Just Joined!
    Join Date
    Sep 2008
    Location
    SC
    Posts
    54
    Ok so I made a file called S99pytest in /etc/rc2.d with this line:

    #!/usr/bin/python /etc/rc2.d/S99pytest

    In the svc error log it is complaining about my use of 'import' to It must still be running it as a shell script.

  4. $spacer_open
    $spacer_close

Posting Permissions

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