Re: Startup script ?

From: Lucas Bergman (lucas_at_fivesight.com)
Date: 01/07/04

  • Next message: Matt Price: "killthread script"
    To: "Marc Hultquist" <marc@cks.co.za>
    Date: Wed, 07 Jan 2004 08:47:10 -0600
    
    

    "Marc Hultquist" <marc@cks.co.za> writes:

    > Ok well using apt-get through the proxy here at work, finally
    > started working, basically I had to import a global variable
    >
    > I.E export http_proxy="blabla/"
    >
    > Now what I wanted to ask, is how do I create a startup script in
    > Debian, so that whenever the machine is re-started, rebooted or
    > anything like that, that when it boots again that it will get the
    > http_proxy for its global variable ? I.E where do I put the script
    > and how do I make it so that the script is run everytime the machine
    > restarts?

    In Unix-like systems, there isn't really such a thing as a "global
    variable". Every process has a set of environment variables, and
    child processes may or may not inherit the environments of their
    parents, and processes are free to alter their own environments.

    That said, if you just want your user ID to get that variable whenever
    you login (this would work if your user ID was the one running
    apt-get, say through 'su' or 'sudo'), then just put the statement in
    ~/.bash_login or ~/.bash_profile or whatever (salt to taste if you
    don't use bash). If there is some script that runs apt-get
    automatically, just set the environment variable in that script.

    The only reliable way that I know of to create an environment variable
    that will get set whenever *lots* of users login, regardless of their
    shells, is to use pam_env. See /etc/pam.d/login,
    /etc/security/pam_env.conf, and the libpam-doc package for more
    information. I'm not sure why you'd want to do this, though.

    Lucas

    -- 
    Lucas Bergman <lucas@fivesight.com>
    Tired of getting duplicate copies of mailing list messages?  I respect
    the 'mail-followup-to' header field: http://cr.yp.to/proto/replyto.html
    -- 
    To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Matt Price: "killthread script"

    Relevant Pages

    • Re: logon/logoff scripts...
      ... I am using the %clientname% and %machine% name environment variables to ... each user you can specify a login script but nowhere do I see the ...
      (microsoft.public.backoffice.smallbiz2000)
    • Re: exporting a variable to global shells
      ... Environment variables are a user-space concept - ... When the script is exiting the echo stdout's the proxy adress, ... setting up my network differently depending on where/what I connect to. ... With regard to actually *setting* the proxy server, ...
      (Debian-User)
    • RE: DBD::Oracle install failed for fork test in t/10general.t
      ... environment variables $ORACLE_SID and $TWO_TASK. ... the connection is local and a dedicated server is bequeathed ... I'm not sure what 'Unix init process' is, ... It works when I ran a script pointing to the 'blib'. ...
      (perl.dbi.users)
    • Re: Which PHP am I running?
      ... php-win.exe) that is currently running (ie. how was this script called) ... apache2handler when I'm running php as a web server module. ... But why does it matter if its using the nix or the windows php ... If you're worried about differences between environment variables ...
      (comp.lang.php)
    • Re: Enviro vars or files
      ... >> I'm in the midst of creating a bash script for uploading files. ... Put the info in different environment variables. ... >> would need to create files that store the information. ... > or if the env file itself sources other env files. ...
      (comp.unix.shell)