Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: mcvax!cs.vu.nl!maart@uunet.uu.net (Maarten Litmaath) Newsgroups: comp.sys.sun Subject: Re: How do you get a remote Sun to reboot itself Keywords: SunOS Message-ID: <3868@kalliope.rice.edu> Date: 14 Jun 89 17:31:19 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 31 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 34, message 1 of 7 trw@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 /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@cs.vu.nl, mcvax!botter!maart