delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/11/06/06:37:48

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <009f01c28588$e3559b40$9c00140a@uk.circle.com>
From: "Vince Hoffman" <vince DOT hoffman AT uk DOT circle DOT com>
To: <cygwin AT cygwin DOT com>
References: <Pine DOT LNX DOT 4 DOT 44 DOT 0211061152190 DOT 10623-100000 AT laud DOT it DOT uc3m DOT es>
Subject: Re: strange error message when running SHUTDOWN.EXE as root (administrator)
Date: Wed, 6 Nov 2002 11:37:29 -0000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300

Just out of curiosity, why not use the cygwin shutdown command ? (or at
least check if it works ;)
----- Original Message -----
From: "Marcos Lorenzo" <marcos AT it DOT uc3m DOT es>
To: <cygwin AT cygwin DOT com>
Sent: Wednesday, November 06, 2002 11:05 AM
Subject: strange error message when running SHUTDOWN.EXE as root
(administrator)


When I run /winnt/NTRESKIT/SHUTDOWN.EXE as root (Local and
Domain Administrator) I get the following error

11:51:04 marcos AT laud~ ssh mozart -l root
root AT mozart's password:
Last login: Wed Nov  6 11:49:45 2002 from laud.it.uc3m.es

Wow! Yeah! this is really a Windows NT 4.0 Cygwin Server

11:51:11 root AT MOZART~ /winnt/NTRESKIT/SHUTDOWN.EXE \\\\it002 /C /R /T:600
"hi, just a test"
Shutdown:\\it002
AdjustTokenPrivileges enable failed.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11:51:17 root AT MOZART~ logout
Connection to mozart closed.


And when I run it as marcos (user belonging to domain administrators) it
executes succesfully:

11:51:18 marcos AT laud~ ssh mozart
marcos AT mozart's password:
Last login: Wed Nov  6 11:49:01 2002 from laud.it.uc3m.es

Wow! Yeah! this is really a Windows NT 4.0 Cygwin Server

11:51:31 marcos AT MOZART~ /winnt/NTRESKIT/SHUTDOWN.EXE \\\\it002 /C /R
/T:600 "hi, just a test"
Shutdown:\\it002
11:51:40 marcos AT MOZART~ /winnt/NTRESKIT/SHUTDOWN.EXE \\\\it002 /A
Shutdown:\\it002
STOP


Any idea? differrence between users is very little, just the fact that
Administrator (root for cygwin) is a builtin account and marcos is created
manually by Administrator.

I need this for a script that I wrote recently. It reboots specified
computers within the domain f the server where the script is run. I want
to run this from cron. It runs perfectly apart from the error of
SHUTDOWN.EXE, that is critical for total script functionality. If any of
you want this script ask for it and I will e-mail it to you.

One more question: Does cron set the $USER variable when running crontabs?
I believe it doesn't for I get the following when running the crontab:

12:03:24 root AT MOZART~ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.324 installed on Wed Nov  6 11:44:14 2002)
# (Cron version -- $Id: crontab.c,v 1.6 2001/09/19 17:09:55 corinna Exp $)
PATH=/root/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin

# MIN  HOUR  DAY MONTH DAYOFWEEK   COMMAND
# every minute touch a timestamp file in /tmp so I know crond is running
  *    *     *   *     *           touch /tmp/crond.running
# update file database every 2 days
  0    0     */2 *     *           updatedb
# reboot every midnight the DIT domain
  0    0     *   *     *           shutdown_dit

### testing section ###

# check user settings and other stuff
  *   *     *   *     *           { echo -e "USER: $USER\nID: `id`" | tee
/tmp/root.debug ; } | mail -s "prueba desde mozart" marcos AT it DOT uc3m DOT es
12:03:25 root AT MOZART~ cat /tmp/root.debug
USER:
ID: uid=500(root) gid=512(domadmin)
groups=0(everyone),513(domusers),544(admin),512(domadmin),545(users)

I get $USER = "". Is this normal? I mean It doesn't bother me, but if it's
a misconfiguration, then maybe my two questions are related.


Thanks in advance,


__________________________________________________________
Marcos Lorenzo de Santiago (Labs Technician)

Departament of Telematic Engineering
University Carlos III Av.Universidad 30 Leganés (Madrid).
Torres Quevedo Building 4.1A01
E-mail: marcos AT it DOT uc3m DOT es, Telephone: (+34)91-624-8757
Home Page http://www.it.uc3m.es/marcos
__________________________________________________________


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019