Also, on any standard sys V, from any terminal window:
'init 1' = go to single user mode
'init 6' = reboot
'init 0' = shutdown/halt
--
E. Kevin Hall
ha...@nmr.mgh.harvard.edu
Jez Page, Manchester UK
There are 2 ways of shutting your system down, once you exit from your WM
and get back to the XDM Login: screen, press CTRL-R to return to the text
based login at which point you can press the CTRL-ALT-DEL sequence to
reboot the computer and shut it off, or login as root and type "shutdown
-h now", alternately, you could go into /sbin and then do a "chmos u+s
shutdown" and then when you are logged in as yourself or ROOT or
whtever..from inside X-Windows itself you can type "shutdown -h now" and
it will shut everything down..Regards
--
/-----------------------------------------------------------------------------\
|Ashwin Bihari University of Massachusetts Lowell|
|E-Mail: abi...@cs.uml.edu Department of Computer Science |
|URL: http://www.cs.uml.edu/~abihari |
|-----------------------------------------------------------------------------|
| NOTE: The E-mail address on top has been mangled to stop Spam Bots..please |
| use the address in this box for replying. |
\-----------------------------------------------------------------------------/
> Yes, I know this is probably a classic FAQ but I haven't yet managed
> to find from man pages etc how to shut down the machine while using
> xdm. ...
As super-user, run ``shutdown''.
Much easier is to switch to a text-mode console with CTL-ALT-F6. Then
use the ``Vulcan Death Grip'' (CTL-ALT-DEL) to run shutdown.
> ... Which documentation tells me?
Hmm, intuition? SHUTDOWN(8), INIT(8).
--
Manfred Bartz <mba...@werple.net.au>
--- LINUX, live free or die ---
> Yes, I know this is probably a classic FAQ but I haven't yet managed
> to find from man pages etc how to shut down the machine while using
> xdm. Which documentation tells me?
>
>
> Jez Page, Manchester UK
You can run programs as root from /var/lib/xdm/Xsetup_0
(or any other file see xdm(1) for the defined resources).
How does this help you?
1) Write a small script eg./usr/sbin/xshutdown
which starts xmessage and shutdown (after xmessage finishes)\
2) from Xsetup_0 start xshutdown.
3) add some cleaning code in Xstartup (user is authenticated)
Now whenever xdm is running, xshutdown is being run and all you have to
users have to do is to click the shutdown button.
As an excercise
a) Work out security implications
b) findout what other files are run as who and when by reading the xdm man page
Have fun!
--
Remco Wouts re...@xray.bmc.uu.se
>You can run programs as root from /var/lib/xdm/Xsetup_0
>(or any other file see xdm(1) for the defined resources).
>How does this help you?
>1) Write a small script eg./usr/sbin/xshutdown
> which starts xmessage and shutdown (after xmessage finishes)\
>2) from Xsetup_0 start xshutdown.
>3) add some cleaning code in Xstartup (user is authenticated)
>Now whenever xdm is running, xshutdown is being run and all you have to
>users have to do is to click the shutdown button.
>As an excercise
>a) Work out security implications
>b) findout what other files are run as who and when by reading the xdm man page
This lot looks promising. I asked the question as at some time my
girlfriend may be using X while surfing the internet. I am trying to
set it up so that everything is as automated as possible - that
includes starting X (using xdm), and logging off and shutting down the
machine.
Jez Page, Manchester UK
I don't have my linux system handy here, so I might have made a
mistake. But you should get the idea. Of course it is not a good idea
to enable any user to shutdown your system if it is part of a
network!!
Happy hacking
--
Remco Wouts re...@xray.bmc.uu.se
Thanks for that, I fancy giving it go (you don't mind me mailing you
for further info if needed do you?).
My machine is only standalone, so network worries there. Ideally I
would like if my girlfriend could just come along, turn the machine
on, choose Linux from the boot manager, log in, surf the web and
send/receive mail, and then shutdown when finished.
Sorry about the delay in my reply, but it has been a while since I
last updated my newsgroup message list.
Jez Page, Manchester UK
RGarciaITT wrote in message
<19971121003...@ladder01.news.aol.com>...
to shut down from xdm
get an xterm window
go superuser
type> shutdown -r now
this will kill all running process, including xdm and reboot the
machine.
To shutdown the system root needs to issue the command 'shutdown -r now'.
So if you want arbitrary users to be able to shutdown the system (bad
idea in a network!!!) you need a way to get ordinary users to use
shutdown.
One way is the ctraltldel command bound (you guessed it) to
CTRL-ALT-DEL. This only works under the console, for the obvious
reason that X takes over all the keybindings. I never tried it but
maybe you can play with xmodmap(1) to get it working from X.
Another way is to use sudo(1) a program that allows you to let
ordinary users run selected commands as superuser eg. the shutdown
command.
If you use X from xdm(1X) there is another way. In /var/X11/xdm/Xsetup
you can place commands to be executed as root eg. your own xshutdown.
The advantage of this is that you can write a small program/script
that only does 'shutdown -r now' as opposed to 'shutdown anytime'
which could be used to play nice pranks on people.
For all these things you don't need to be a UNIX wizard, just take the
patience to use 'man -k subject' and then read the relevant pages.
The lazy way is to use www.dejanews.com and see what people already
wrote about this subject.
I hope that all of you soon will enjoy the thrill of having written
some nice and simple scripts YOURSELF that do something really useful
under Linux.
--
Remco Wouts re...@xray.bmc.uu.se
[essay snipped]
Why not simply *first* press Ctrl-Alt-Backspace (shutdown X) and *then*
while the screen is black give the three-finger-salute (Ctrl-Alt-Del).
My kids do it all the time...
-- lars.kri...@ne.su.se, Dept of Economics, Stockholm Univ
Tel:+46-8-16 31 13, Fax:+46-8-15 94 82, Mob:+46-70-667 62 63
"Make it idiot proof, and somebody will make a better idiot."
> Why not simply *first* press Ctrl-Alt-Backspace (shutdown X) and *then*
> while the screen is black give the three-finger-salute (Ctrl-Alt-Del).
Ctrl+Alt+R quits the xdm-login-session, so that you could press
Ctrl+Alt+Del to reboot.
BTW: Is there any way to return to the xdm-login-session after
pressing Ctrl+Alt+R?
--
Florian Wolff (0xA98E02CD) 2DA5756698691F16 CF79A692B42E5DED
F.W...@tu-harburg.de ePlus mobil phone +49.177.2388001
www - homepage http://www.tu-harburg.de/~sefw1409/index.html
Student of electrical engineering, TU Hamburg-Harburg, Germany
> Lars Kristensson wrote:
[...]
> BTW: Is there any way to return to the xdm-login-session after
> pressing Ctrl+Alt+R?
as root:
kill -1 <pid-of-xdm>
--Stefan
> Perhaps this is just my linux, but CtrlAltDel will _not_ shutdown my system
> since I enabled XDM, whether from the XWindow desktop or an XTerm.
Switch to a virtual console first (ie ctrl-alt-F1) and then do ctrl-alt-del
But is it really too hard to do:
$ su
# /sbin/shutdown -h now
everyone?
No, but it does seem a little dangerous to run root without a password.
Good luck,
John
I have the following installed as "xshutdown"
#!/usr/bin/wish
set tfont 6x13
proc shutdown {} {
exec /sbin/shutdown -t 5 -h now >&/dev/tty1 &
exit
}
proc restart {} {
exec /sbin/shutdown -t 5 -r now >&/dev/tty1 &
exit
}
button .shutdown -text "Shutdown" -font $tfont -command shutdown
button .restart -text "Restart" -font $tfont -command restart
pack .shutdown .restart -side left
and run it from /etc/X11/xdm/Xsetup_0 and stop it from Xstartup_0. Places a
nice little shutdown/restart button in the corner of the xdm screen, and
makes things a lot easier...
Colin
>Why not simply *first* press Ctrl-Alt-Backspace (shutdown X) and *then*
>while the screen is black give the three-finger-salute (Ctrl-Alt-Del).
>My kids do it all the time...
Kids may be one thing, but girlfriends are a different matter! :)
Jez Page, Manchester UK
>I have the following installed as "xshutdown"
>
>#!/usr/bin/wish
>set tfont 6x13
>proc shutdown {} {
> exec /sbin/shutdown -t 5 -h now >&/dev/tty1 &
> exit
>}
>proc restart {} {
> exec /sbin/shutdown -t 5 -r now >&/dev/tty1 &
> exit
>}
>button .shutdown -text "Shutdown" -font $tfont -command shutdown
>button .restart -text "Restart" -font $tfont -command restart
>pack .shutdown .restart -side left
>
>and run it from /etc/X11/xdm/Xsetup_0 and stop it from Xstartup_0. Places a
>nice little shutdown/restart button in the corner of the xdm screen, and
>makes things a lot easier...
Now that looks just about perfect. I'll just have to see if it is
suitable.
Jez Page, Manchester UK
Also, you can change runlevels in an xterm window, "init 3". Check
"/etc/inittab" to see which Runlevel is used by 'xdm'.