Xref: utzoo comp.unix.wizards:8501 comp.unix.xenix:2267 Path: utzoo!attcan!uunet!ccicpg!turnkey!conexch!root From: root@conexch.UUCP (Larry Dighera) Newsgroups: comp.unix.wizards,comp.unix.xenix Subject: Re: multi/single-user mode flag? Summary: Who -r displays the current run level Message-ID: <340@conexch.UUCP> Date: 15 May 88 20:03:54 GMT References: <3595@psuvax1.psu.edu> <243@oha.UUCP> Reply-To: root@conexch.UUCP (Larry Dighera) Organization: The Consultants' Exchange, Orange County, CA. (714) 842-6348 Lines: 37 In article <243@oha.UUCP> tony@oha.UUCP (Tony Olekshy) writes: >In <3595@psuvax1.psu.edu> okunewck@gondor.cs.psu.edu (Phil OKunewick) writes: >> >> Therefore, I want something that will tell my operator "Do not do it this >> way you fool" if he tries to dump in multi-user mode. > >We are running Xenix V here, and Xenix V uses /.profile before $HOME/.profile I think Tony means /etc/profile not /.profile. /.profile is traditionally root's $HOME/.profile. >only when starting the top-level single-user-mode sh. I have placed: > > SU_MODE=1; export SU_MODE > >in /.profile only, so I can always determine if I am in single user mode just >by examining "$SU_MODE". If your system lets you determine if you are in >single user mode during the shell startup script then you can use this too. What happens when the 'init s' or 'init 1' is issued? I don't think Tony's fix is general enough for Phil's problem. The normal way for a Sys V user to determine which run level state the system is in, is to do a 'who -r'. Surely this could be exploited for Phil's purpose, although his original article didn't indicate what version of Unix is being run at his site. Who's -r option isn't supported yet in SCO's Xenix, but should be soon. Hope this helps. Larry Dighera -- USPS: The Consultants' Exchange, PO Box 12100, Santa Ana, CA 92712 TELE: (714) 842-6348: BBS (N81); (714) 842-5851: Xenix guest account (E71) UUCP: conexch Any ACU 2400 17148425851 ogin:-""-ogin:-""-ogin: nuucp UUCP: ...!ucbvax!ucivax!icnvax!conexch!root || ...!trwrb!ucla-an!conexch!root