How do you get a remote Sun to reboot itself

Maarten Litmaath mcvax!cs.vu.nl!maart at uunet.uu.net
Thu Jun 15 03:31:19 AEST 1989


trw at hrc63.co.uk (Trevor Wright) writes:
\...
\The problem is that in order to do this from the central system you need to
\issue a "rsh <machine name> /etc/reboot" or similar.

\The Question: How do you sensibly reboot the far machine so that you do
\not hang yourself until it is rebooted, and do not generate vast numbers
\of processes (which eventually overflow the max number allowed)

Using csh on the remote machine:

    rsh machine -n '(sleep 30; /etc/reboot) >& /dev/null < /dev/null &'

Using sh:

    rsh machine -n '(sleep 30; /etc/reboot) > /dev/null 2>&1 < /dev/null &'

Explanation:

1)	`-n' attaches rsh's stdin to /dev/null, so you can run it in the
	background
2)	the `sleep 30' is there to be sure the rsh session has been
	terminated before the reboot starts
3)	the input/output redirections make sure rsh thinks the session can
	be terminated (there's no data flow anymore)

Various parts of these complicated commands could be left out; however, now
we're sure all rsh `nasties' have been dealt with.
-- 
"I HATE arbitrary limits, especially when |Maarten Litmaath @ VU Amsterdam:
   they're small."  (Stephen Savitzky)    |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.sys.sun mailing list