* [9fans] cron and lib/profile
@ 2007-03-26 17:08 gas
2007-03-27 17:21 ` Heiko Dudzus
0 siblings, 1 reply; 4+ messages in thread
From: gas @ 2007-03-26 17:08 UTC (permalink / raw)
To: 9fans
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9fans] cron and lib/profile
2007-03-26 17:08 [9fans] cron and lib/profile gas
@ 2007-03-27 17:21 ` Heiko Dudzus
2007-03-27 17:33 ` Russ Cox
0 siblings, 1 reply; 4+ messages in thread
From: Heiko Dudzus @ 2007-03-27 17:21 UTC (permalink / raw)
To: 9fans
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9fans] cron and lib/profile
2007-03-27 17:21 ` Heiko Dudzus
@ 2007-03-27 17:33 ` Russ Cox
2007-03-27 19:05 ` gas
0 siblings, 1 reply; 4+ messages in thread
From: Russ Cox @ 2007-03-27 17:33 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [9fans] cron and lib/profile
2007-03-27 17:33 ` Russ Cox
@ 2007-03-27 19:05 ` gas
0 siblings, 0 replies; 4+ messages in thread
From: gas @ 2007-03-27 19:05 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-03-27 19:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-26 17:08 [9fans] cron and lib/profile gas
2007-03-27 17:21 ` Heiko Dudzus
2007-03-27 17:33 ` Russ Cox
2007-03-27 19:05 ` gas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).