sudo in startup script

From: Pedro Pinto (ppinto_at_cs.cmu.edu)
Date: 08/29/04

  • Next message: Georg Klein: "Re: Portupgrade problem"
    Date: Sun, 29 Aug 2004 16:10:57 GMT
    
    

    Hi there,

    I am tyring to install the perforce source control system on my new BSD
    5.2.1. I want perforce to run under user perforce instead of root. I
    would rather not use setuid. I have tried installing the following
    script in /usr/local/etc/rc.d/p4.sh

    #!/bin/sh

    # start
    if [ "x$1" = "x" -o "x$1" = "xstart" ]; then
         sudo -u perforce -b /usr/local/p4/start-p4
    # stop
    elif [ "x$1" = "xstop" ]; then
             killall p4d
    fi

    where start-p4 is a sh script that sets some env variables, sets umask
    and then spawns perforce. This works fine if I run the script on the
    command line but it does not work at startup. Some experimantion seems
    to indicate that the culprit is sudo (i.e. I cannot start anything else
    with sudo at startup and if I remove sudo from the above script
    everything works).

    Any ideas?

    TIA,
    -pp


  • Next message: Georg Klein: "Re: Portupgrade problem"

    Relevant Pages

    • Re: Use system to start a server then execute commands on it
      ... execute commands on the server process external to the script (the ... While the script sleeps I can access the ... perforce process it spawns but when the ...
      (comp.lang.perl.misc)
    • Re: How to retrieve a directory tree from perforce.freebsd.org?
      ... Time for a script to workaround perforce's needlessly ... I have been tinkering with scripts which pull changesets from Perforce ... If there is a specific part of the Perforce tree you are interested in, ... grabbed by git and cvsup as well as the repository system you're now ...
      (freebsd-questions)
    • Re: Use system to start a server then execute commands on it
      ... been made (i.e. as if perforce is not running). ... The call to system does not fail - the perforce server does indeed ... any commands I'd like to run on the sever ... from within the script react as if the server isn't started. ...
      (comp.lang.perl.misc)
    • Re: How to retrieve a directory tree from perforce.freebsd.org?
      ... Time for a script to workaround perforce's needlessly ... I have been tinkering with scripts which pull changesets from Perforce ... If there is a specific part of the Perforce tree you are interested in, ...
      (freebsd-questions)
    • Re: sudo in startup script
      ... > I am tyring to install the perforce source control system on my new BSD ... I want perforce to run under user perforce instead of root. ... > where start-p4 is a sh script that sets some env variables, sets umask ... This works fine if I run the script on the ...
      (comp.unix.bsd.freebsd.misc)