This is the old SliTaz forum - Please use the main forum.slitaz.org

launch a script as a user at boot time.
  • XavierJXavierJ October 2010
    Hello,

    I need to run a program when the system boot. But I want to run it as a particular user (and in background, to not stop the boot).

    I know that I have to put it in local.sh. I tried to run : su user -c "cmd". But ps -e doesn't show the process.

    any idea ? :)
  • loislois October 2010
    you can add a line to /home/user/.config/openbox/autostart.sh
    to run the process in background add a '&' after the command.
    eg.
    xterm &
  • seawolfseawolf October 2010
    (sorry, wrong thread!)
  • XavierJXavierJ October 2010
    Sorry, I forgot to add that I'm using a base flavor a little customized, but with no X. I can't use openbox.
  • loislois October 2010
    which command do you want to run?
    su -c "cmd" user &
    should work, at least if it is run as root (which shuld be in local.sh) and "cmd" is executable by user "user" .
  • XavierJXavierJ October 2010
    It should work, but it doen't :o

    I want to run a program. It works if I run it in the foreground, but not in the background.
    I don't know why it's dying when ran in bg.
  • XavierJXavierJ October 2010
    It should work, but it doen't :o

    I want to run a program. It works if I run it in the foreground, but not in the background.
    I don't know why it's dying when ran in bg.
  • seawolfseawolf October 2010
    Do you get any output if you run it as:
    su -c "cmd" user > /cmd.log 2>&1 &?
  • XavierJXavierJ October 2010
    Sorry I'm late :o

    It didn't work no. But It must be because I launched the script in local.sh : this script is launched by rcS, which quit at the end of the boot process, thus killing its sons.
    I should run it as a daemon.
  • XavierJXavierJ October 2010
    -
  • severnyseverny December 2010
    Use /etc/inittab

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social