Results 1 to 10 of 10

Thread: Help with startup script - Debian

  1. #1
    And then I was mod. Tidder's Avatar
    Join Date
    Sep 2003
    Location
    New Mexico, USA
    Posts
    4,207

    Help with startup script - Debian

    Ok... I'm running Debian, and having a bit of a problem here. I need a script that runs from init.d to be able to start as someone other than root. I've been playing around with su - username -c "/cantrememberpath/mserv" || exit 0

    But it just won't do it. It'll at least start that way, but i can't shut it down, can't do anything, it just sits there displaying the garbage from the prog on the screen. It doesn't finish running the rest of the scripts... am I retarded? Should I be starting it from somewhere else? without the su stuff, it starts fine, it just doesn't work because it's not designed to run as root.

    I am by no means a linux dude, I'm definitely an uber-noob. Man this stuff is different...
    Tidder

    Try RevFE
    The best resurrected frontend I've ever used, period.

  2. #2
    And then I was mod. Tidder's Avatar
    Join Date
    Sep 2003
    Location
    New Mexico, USA
    Posts
    4,207
    nobody eh?
    Tidder

    Try RevFE
    The best resurrected frontend I've ever used, period.

  3. #3
    blk
    blk is offline
    Newbie blk's Avatar
    Join Date
    Jun 2006
    Location
    Switzerland
    Posts
    44
    no need to reply to yourself...

    try putting this script in /etc/init.d/mserv

    Code:
    #!/bin/sh
    su nobody
    /cantrememberpath/mserv
    exit 0
    and symlink

    Code:
    for i in {1..5};
    do ln -s /etc/init.d/mserv /etc/rc$i.d/mserv;
    done;

  4. #4
    And then I was mod. Tidder's Avatar
    Join Date
    Sep 2003
    Location
    New Mexico, USA
    Posts
    4,207
    Quote Originally Posted by blk
    no need to reply to yourself...
    But I like it.
    Quote Originally Posted by blk
    try putting this script in /etc/init.d/mserv

    Code:
    #!/bin/sh
    su nobody
    /cantrememberpath/mserv
    exit 0
    I'll try it right now.
    Quote Originally Posted by blk
    and symlink

    Code:
    for i in {1..5};
    do ln -s /etc/init.d/mserv /etc/rc$i.d/mserv;
    done;
    I'm guess I'm a little unknowing on this. Where does this go?
    Tidder

    Try RevFE
    The best resurrected frontend I've ever used, period.

  5. #5
    And then I was mod. Tidder's Avatar
    Join Date
    Sep 2003
    Location
    New Mexico, USA
    Posts
    4,207
    Heh, nevermind.
    Tidder

    Try RevFE
    The best resurrected frontend I've ever used, period.

  6. #6
    And then I was mod. Tidder's Avatar
    Join Date
    Sep 2003
    Location
    New Mexico, USA
    Posts
    4,207
    Didn't work. Says to me "no job control in this shell".
    Tidder

    Try RevFE
    The best resurrected frontend I've ever used, period.

  7. #7
    Raw Wave shotgunefx's Avatar
    Join Date
    Apr 2005
    Location
    Boston, MA
    Posts
    1,800
    Maybe make a batch script to wrap it up that drops privlege and then run the command? (I'm thinking that will make it get it's own shell)

    It might be because STOUT and STDERR are still connected to root. Not sure

  8. #8
    Newbie
    Join Date
    Nov 2006
    Location
    Akron, Ohio
    Posts
    7
    If it's just an issue of not continuing with the init scripts, and if it's not a dependency of something else, you can probably just add a &

    su - username -c "/cantrememberpath/mserv" &

    -Link

  9. #9
    Newbie UrbanSoot's Avatar
    Join Date
    May 2006
    Location
    West Hollywood, CA
    Posts
    35
    or you might have problems with permissions. post results of this:
    ls -l /cantrememberpath/mserv

  10. #10
    And then I was mod. Tidder's Avatar
    Join Date
    Sep 2003
    Location
    New Mexico, USA
    Posts
    4,207
    Thanks, but I figured it out guys, I ended up using a proggy called rungetty. Worked perfect.

    Heh, sorry for the late reply.
    Tidder

    Try RevFE
    The best resurrected frontend I've ever used, period.

Similar Threads

  1. Survey: Startup times and methods
    By gnomad in forum General MP3Car Discussion
    Replies: 56
    Last Post: 01-02-2007, 12:55 PM
  2. Replies: 6
    Last Post: 06-02-2006, 10:20 AM
  3. XM as startup command
    By skippy76 in forum RR Bug Tracker
    Replies: 1
    Last Post: 10-07-2005, 07:01 PM
  4. Any AutoIt script experts out there?
    By mindracing in forum Centrafuse
    Replies: 8
    Last Post: 08-11-2005, 03:19 PM
  5. Debian Linux Questions
    By Scorpion1985 in forum Software & Software Development
    Replies: 6
    Last Post: 09-04-2004, 12:04 PM

Bookmarks

Posting Permissions

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