I can confirm this too. I noticed last week that a user wasn't on a node
but thought it was an oversight on my side due to offline nodes, etc.
I just checked Randy's example
node0: $ grep sync /etc/crontab
# */15 * * * * root /opt/opium/bin/sync_users >/dev/null 2>&1
*/15 * * * * root /opt/opium/bin/sync_users >/tmp/sync_users.log 2>&1
and got the following,
node0: $ cat /tmp/sync_users.log
Traceback (most recent call last):
File "/opt/c3-4/cpush", line 216, in ?
defusername = os.environ[ 'USER' ]
File "/usr/lib/python2.2/UserDict.py", line 14, in __getitem__
def __getitem__(self, key): return self.data[key]
KeyError: USER
Can't push file /opt/opium/tmp/etc/passwd to /etc/passwd!
and then added the "USER=$LOGNAME" as he noted and things worked. So, this
looks like a C3 "bug" for lack of a better term. Basically, it checks to
see if the EnvVar "C3_USER" exists and if not uses the value in "USER".
But if "USER" isn't defined... :(
So, for now the quick fix is to make sure 'USER' or 'C3_USER' is set before
running a "cpush" command or script that uses it from a crontab... or as
done here, just hardcode it to some know valid value.
--tjn
_________________________________________________________________________
Thomas Naughton [EMAIL PROTECTED]
Research Associate (865) 576-4184
On Tue, 1 Jun 2004, Randy Philipp wrote:
> I am using vixie-cron-3.0.1-74, the stock cron daemon from RedHat 9 and
> sync_users-oscar-1.5-5, the version of sync_user with Oscar 3.0. The
> problem I get is that sync_user will not sync accounts across the cluster.
> sync_user errors out with a complaint about "USER" environment variable
> not set. You can see the error if you pipe the output of sync_user to a
> file intead of /dev/null.
>
> Randy
>
> On Tue, 1 Jun 2004, Jason Brechin wrote:
>
> > I have not seen this problem using the cron supplied with RedHat 8.0 or
> > 9. What errors are you getting when the USER variable isn't set? What
> > version of sync_users are you using?
> >
> > Jason
> >
> > On Mon, 2004-05-24 at 09:18, Randy Philipp wrote:
> > > I have run into the problem that vixie-cron-3.0.1-74 on RedHat 9 is not
> > > setting USER environment variable when running the sync_user cron job.
> > > This breaks sync_user, and it will not work. It works fine if you run it
> > > by hand. Has anyone else run into this problem on RedHat 9?
> > >
> > > The current fix I have put in place it modify sync_user to use the
> > > following cron entry:
> > >
> > > */15 * * * * root USER=$LOGNAME /opt/opium/bin/sync_users >/dev/null 2>&1
> > >
> > > In sync_user, be sure to change the definition of $cronline to the
> > > following:
> > >
> > > $cronline = "*/$crondelay * * * * root USER=\$LOGNAME
> > > /opt/opium/bin/sync_users >/dev/null 2>&1\n";
> > >
> > > This is line 120 of sync_user.
> > >
> > > Hope someone finds this useful.
> > >
> > > Randy
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by: Oracle 10g
> > > Get certified on the hottest thing ever to hit the market... Oracle 10g.
> > > Take an Oracle 10g class now, and we'll give you the exam FREE.
> > > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
> > > _______________________________________________
> > > Oscar-users mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/oscar-users
> >
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the new InstallShield X.
> From Windows to Linux, servers to mobile, InstallShield X is the one
> installation-authoring solution that does it all. Learn more and
> evaluate today! http://www.installshield.com/Dev2Dev/0504
> _______________________________________________
> Oscar-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/oscar-users
>
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Oscar-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/oscar-users