Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcsun!unido!gtc!pemstgt!tb From: tb@pemstgt.gtc.de (Tillmann Basien) Newsgroups: comp.unix.xenix Subject: Re: XENIX command 'haltsys' equivalent in UNIX? Keywords: haltsys Message-ID: <1990Aug12.183729.1993@pemstgt.gtc.de> Date: 12 Aug 90 18:37:29 GMT References: <1990Aug8.203015.16746@nttor.uucp> Organization: PEM Tillmann Basien, Stuttgart, West-Germany Lines: 57 teresa@nttor.uucp (Teresa Fung) writes: >Can someone tell me what the equivalent command in >UNIX SYSTEM V/68 to the XENIX OS 'haltsys' is? >The closest command that I have found is shutdown but >it doesn't give the user a choice to power down or >reboot (by hitting a key). >Thanks in advance for the help. I don't know, wether I understand this question correctly. But it looks like the problem, that I have had on SCO XENIX 2.3.2. I have some users on my system, who are authorized to shutdown the system. I have a modified shutdown-programm called userdown. See below. This script can be started from every user, who is included in shutdown script. Modify the shutdown-script in the first lines like shown below: set -- `who am i` case $1 in root|sysadm|||"") : OK ;; *)echo "shutdown: must run in the foreground by root or sysadm." >&2 The Programm must have the following permissions:: -rwsr-xr-x 1 root pem 22071 Jul 04 17:50 userdown But the programm on /usr/bin . This is the programm #include #include void main() { char p[100]; if( setuid(0) == 0 && setgid(0) ==0) { sprintf(p,"cd / ; /etc/shutdown 0 "); system(p); } else { perror("Can't set uid/gid"); } } -- Dipl.Ing. Tillmann Basien Programmentwicklung fuer Microcomputer Vaihinger Str.49, PostBox 810165 +49-711-713047 FAX 7000 Stuttgart 80- West Germany +49-711-713045 PHONE