*nix startup script, as user

Discussion in 'OT Technology' started by Rob Jones, May 15, 2007.

  1. Rob Jones

    Rob Jones what up

    Joined:
    Aug 19, 2006
    Messages:
    3,113
    Likes Received:
    0
    Location:
    San Antonio
    does anyone know how to make a startup script but run the app as a certain user?
     
  2. crontab

    crontab (uid = 0)

    Joined:
    Nov 14, 2000
    Messages:
    23,439
    Likes Received:
    11
    su - "user" "command/script" you want to run

    man su for slighlty more info.

    make sure you source the environment you want like

    su - mikehunt "/home/mikehunt/.bash_profile;/opt/APP/bin/application"
     
  3. Rob Jones

    Rob Jones what up

    Joined:
    Aug 19, 2006
    Messages:
    3,113
    Likes Received:
    0
    Location:
    San Antonio
    so simple. i'm not thinking tonight :mamoru:
     
  4. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    I have nothing useful to contribute to this thread.
     
  5. retorq

    retorq What up bitch??

    Joined:
    Dec 14, 2006
    Messages:
    6,061
    Likes Received:
    0
    Location:
    Mohave Desert
    Fixt. ;)

     
  6. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    do you want it to run everytime the user logs in?

    assuming user is using bash, you can put whatever commands in:
    /home/username/.bashrc
     
  7. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Excuse me? Who are you?
     

Share This Page