How to Start Program at Boot-Time as Normal User - Setup

This is a discussion on How to Start Program at Boot-Time as Normal User - Setup ; Hi there, As we know, if I want to start a program after a system reboot, I Could add a startup script to the system startup files (typically rc.local or a file in an rc.N directory). But this will start ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: How to Start Program at Boot-Time as Normal User

  1. How to Start Program at Boot-Time as Normal User

    Hi there,
    As we know, if I want to start a program after a system reboot, I Could add
    a startup script to the system startup files (typically rc.local or a file
    in an rc.N directory). But this will start the prgram as root.
    What I want is to start the program as a normal user (e.g. ross).
    How could I do that?
    Thanks in advance,
    Ross



  2. Re: How to Start Program at Boot-Time as Normal User

    "Ross" wrote in message
    news:Y7ednf21jYSJBbvYnZ2dnUVZ_tydnZ2d@magma.ca


    > As we know, if I want to start a program after a system reboot, I
    > Could add a startup script to the system startup files (typically
    > rc.local or a file in an rc.N directory). But this will start the
    > prgram as root.
    > What I want is to start the program as a normal user (e.g. ross).
    > How could I do that?


    Instead of merely invoking the command in the script which is run as root,
    use

    su ross -c "/path/to/script args"

    Omit the quotes if no args are required. "man su" for further information.


  3. Re: How to Start Program at Boot-Time as Normal User

    On Fri, 6 Oct 2006 13:53:23 -0400, Ross wrote:


    >Hi there,
    >As we know, if I want to start a program after a system reboot, I Could add
    >a startup script to the system startup files (typically rc.local or a file
    >in an rc.N directory). But this will start the prgram as root.
    >What I want is to start the program as a normal user (e.g. ross).
    >How could I do that?


    man su
    su ross -c "command to execute"




  4. Re: How to Start Program at Boot-Time as Normal User

    On Fri, 06 Oct 2006 13:53:23 -0400, Ross wrote:

    > Hi there,
    > As we know, if I want to start a program after a system reboot, I Could add
    > a startup script to the system startup files (typically rc.local or a file
    > in an rc.N directory). But this will start the prgram as root.
    > What I want is to start the program as a normal user (e.g. ross).
    > How could I do that?
    > Thanks in advance,
    > Ross


    "sudo -u username" can be used for this.


  5. Re: How to Start Program at Boot-Time as Normal User

    On Mon, 09 Oct 2006 00:43:04 -0500, Vaxius wrote:
    | On Fri, 06 Oct 2006 13:53:23 -0400, Ross wrote:
    |
    |> Hi there,
    |> As we know, if I want to start a program after a system reboot, I Could add
    |> a startup script to the system startup files (typically rc.local or a file
    |> in an rc.N directory). But this will start the prgram as root.
    |> What I want is to start the program as a normal user (e.g. ross).
    |> How could I do that?
    |> Thanks in advance,
    |> Ross
    |
    | "sudo -u username" can be used for this.


    This is root becoming another user, so I think that plain "su" would be
    more appropriate.

    su username -c command_to_execute command_options


    --
    Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/~paulcol
    Asking for technical help in newsgroups? Read this first:
    http://catb.org/~esr/faqs/smart-questions.html#intro

  6. Re: How to Start Program at Boot-Time as Normal User

    On Mon, 09 Oct 2006 07:09:04 +0000, Paul Colquhoun had the audacity to
    write:

    > On Mon, 09 Oct 2006 00:43:04 -0500, Vaxius wrote:
    > | On Fri, 06 Oct 2006 13:53:23 -0400, Ross wrote:
    > |

    - - - - - - - %< - - - - -
    > |
    > | "sudo -u username" can be used for this.
    >
    >
    > This is root becoming another user, so I think that plain "su" would be
    > more appropriate.
    >
    > su username -c command_to_execute command_options


    The little minus-sign has some significance after all.
    IME:
    su logs you in as and drops you where you might be
    situated in the file-tree at the time of command.
    su - logs you in at the home directory of period!
    This can have some noticeable differences in some cases!

    If I'm not totally mistaken, it also has some significant influence on
    what environment you inherit...

    --
    Jan, OZ1DKE.

    Crossposting reduced...



  7. Re: How to Start Program at Boot-Time as Normal User

    On Mon, 09 Oct 2006 07:09:04 +0000, Paul Colquhoun wrote:

    > On Mon, 09 Oct 2006 00:43:04 -0500, Vaxius wrote:
    > | On Fri, 06 Oct 2006 13:53:23 -0400, Ross wrote:
    > |
    > |> Hi there,
    > |> As we know, if I want to start a program after a system reboot, I Could add
    > |> a startup script to the system startup files (typically rc.local or a file
    > |> in an rc.N directory). But this will start the prgram as root.
    > |> What I want is to start the program as a normal user (e.g. ross).
    > |> How could I do that?
    > |> Thanks in advance,
    > |> Ross
    > |
    > | "sudo -u username" can be used for this.
    >
    >
    > This is root becoming another user, so I think that plain "su" would be
    > more appropriate.
    >
    > su username -c command_to_execute command_options


    Oops, guess I made a noobish mistake *flogs himself*, although I was
    falling asleep while writing it. Thanks for the correction.


  8. Re: How to Start Program at Boot-Time as Normal User

    On 2006-10-09, Jan Sevelsted wrote:
    > On Mon, 09 Oct 2006 07:09:04 +0000, Paul Colquhoun had the audacity to
    > write:
    >
    >> On Mon, 09 Oct 2006 00:43:04 -0500, Vaxius wrote:
    >> | On Fri, 06 Oct 2006 13:53:23 -0400, Ross wrote:
    >> |

    > - - - - - - - %< - - - - -
    >> |
    >> | "sudo -u username" can be used for this.
    >>
    >>
    >> This is root becoming another user, so I think that plain "su" would be
    >> more appropriate.
    >>
    >> su username -c command_to_execute command_options

    >
    > The little minus-sign has some significance after all.
    > IME:
    > su logs you in as and drops you where you might be
    > situated in the file-tree at the time of command.
    > su - logs you in at the home directory of period!
    > This can have some noticeable differences in some cases!


    The latter generates a syntax error; it should be:

    su -

    > If I'm not totally mistaken, it also has some significant influence on
    > what environment you inherit...


    Without the dash, all that is changed is the UID and username;
    with it, you are given the user's login environment.

    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

  9. Re: How to Start Program at Boot-Time as Normal User

    Ross enlightened us comp.os.linux-(ab)users with:

    > Hi there,
    > As we know, if I want to start a program after a system reboot, I
    > Could add a startup script to the system startup files (typically
    > rc.local or a file in an rc.N directory). But this will start the
    > prgram as root. What I want is to start the program as a normal user
    > (e.g. ross). How could I do that?


    Another alternative to su examples would be fcron and fcrontab. It does
    not only allow time-driven events, but specifications like "once on
    startup".

    --
    vista policy violation: Microsoft optical mouse found penguin patterns
    on mousepad. Partition scan in progress to remove offending
    incompatible products. Reactivate MS software.
    Linux 2.6.17-mm1,Xorg7.1/nvidia [LinuxCounter#295241,ICQ#4918962]

+ Reply to Thread