teresa@nttor.uucp (Teresa Fung) (08/09/90)
Can someone tell me what the equivalent command in UNIX SYSTEM V/68 to the XENIX OS 'haltsys' is? To quote the XENIX manual, haltsys : ... flush out pending disk I/O, mark the file systems clean and halt the processor ... displays a prompt indicating that the system has been shut down and can be rebooted OR powered down ... 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. Teresa Fung Northern Telecom ... and the general disclosure stuff... :-) -- Teresa Fung
tb@pemstgt.gtc.de (Tillmann Basien) (08/13/90)
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|<user1>|<user2>|"") : 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 <stdio.h> #include <errno.h> 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