[9fans] cron and lib/profile - Plan9

This is a discussion on [9fans] cron and lib/profile - Plan9 ; Cron (w. host=local) does not seem to read $home/lib/profile, so all the binds there are missing. Should it not behave as if the user logged in and typed the command manually? __________________________________________________ _______ Flyger tiden iväg? Fånga dagen med Yahoo! ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: [9fans] cron and lib/profile

  1. [9fans] cron and lib/profile

    Cron (w. host=local) does not seem to read $home/lib/profile, so all
    the binds there are missing. Should it not behave as if the user logged
    in and typed the command manually?






    __________________________________________________ _______
    Flyger tiden iväg? Fånga dagen med Yahoo! Mails inbyggda
    kalender. Dessutom 250 MB gratis, virusscanning och antispam. Få den på: http://se.mail.yahoo.com

  2. Re: [9fans] cron and lib/profile

    smurfasmurf wrote:
    > Cron (w. host=local) does not seem to read $home/lib/profile, so all
    > the binds there are missing. Should it not behave as if the user logged
    > in and typed the command manually?


    With host=local, the command runs in a namespace as in /lib/namespace.
    If you need the bindings made in your lib/profile you can use the
    explicit name of the CPU server as hostname.

    In the latter case, rx(1) and rexexec(8) are used. Rexexec does:
    execl("/bin/rc", "rc", "-lc", buf, nil);
    to run the commands in it. (The -l flag causes rc to read lib/profile.)

    whereas, if host is 'local', cron does:
    execl("/bin/rc", "rc", "-c", buf, nil);

    The I can't tell if the difference in behaviour is intended. But you
    can work around it that way.

    Heiko


  3. Re: [9fans] cron and lib/profile

    This is left over from when localcron was a separate program.
    Then it didn't even create a new name space. It just ran as
    the local user in the name space in which it started.

    It would probably make sense to change cron to do:

    putenv("service", "rx");
    execl("/bin/rc", "rc", "-lc", buf, nil);

    to be more like rexexec. Perhaps $service should be
    "cron", but "rx" seems okay.

    Russ

  4. Re: [9fans] cron and lib/profile

    Heiko, Russ - thanks. It works as expected with the explicit name. The
    "local" made me somewhat confused; it just failed silently.

    / G.A.





    __________________________________________________ _______
    Flyger tiden iväg? Fånga dagen med Yahoo! Mails inbyggda
    kalender. Dessutom 250 MB gratis, virusscanning och antispam. Få den på: http://se.mail.yahoo.com

+ Reply to Thread