SCIENTIFIC-LINUX-USERS Archives

June 2012

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Adam Tilghman <[log in to unmask]>
Reply To:
Adam Tilghman <[log in to unmask]>
Date:
Fri, 22 Jun 2012 09:31:34 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (34 lines)
On Fri, Jun 22, 2012 at 05:11:52PM +0100, t m wrote:
> I canīt use local media like USB or CD/DVD cause I have no physical access to the VPS.
> I will check for remote console access. I think I saw something like that in my control panel.

Here's the script I use to trigger a remote reinstall.
(If you're not using kickstart you could remove the "ks=" and "ksdevice=" entries,
in which case you'd obtain an interactive install.)

$KERN and $INITRD are "vmlinuz" and "initrd.img" taken from the CentOS boot CD.
Also, you'll need to install "kexec-tools".


#!/bin/bash
export PATH=/usr/sbin:/sbin:$PATH

KSSERVER=some.name.com
ARCH=`uname -i`
KERN=/boot/vmlinuz-${ARCH}-REINSTALL
INITRD=/boot/initrd-${ARCH}-REINSTALL.img
ARGSA="ks=http://${KSSERVER}/CentOS6-cgi-bin/ks.cgi/arch=$ARCH ksdevice=eth0"
ARGSB="vga=0"

if kexec -l $KERN --initrd=$INITRD --append="$ARGSA $ARGSB"; then
        chvt 1
        /sbin/shutdown -r now
else
        echo "kexec() failed; will not reboot"
fi


-- 
Adam Tilghman   Systems Support / Academic Computing & Media Services
 [log in to unmask]    858-822-0711     University of California, San Diego   

ATOM RSS1 RSS2