Just out of curiosity, why not use the cygwin shutdown command ? (or at least check if it works ;) ----- Original Message ----- From: "Marcos Lorenzo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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@laud~ ssh mozart -l root root@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@MOZART~ /winnt/NTRESKIT/SHUTDOWN.EXE \\\\it002 /C /R /T:600 "hi, just a test" Shutdown:\\it002 AdjustTokenPrivileges enable failed. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 11:51:17 root@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@laud~ ssh mozart marcos@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@MOZART~ /winnt/NTRESKIT/SHUTDOWN.EXE \\\\it002 /C /R /T:600 "hi, just a test" Shutdown:\\it002 11:51:40 marcos@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@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" [EMAIL PROTECTED] 12:03:25 root@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: [EMAIL PROTECTED], 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/