sys-unconfig not the all powerful tool I thought it was

So I was working with a customer the other day setting up a template in OVM to use as a gold image.  The last step we took was to run sys-unconfig to wipe out all traces of the networking we had set up.  I used to think this basically wipes out all aspects of a systems configuration, silly me!  On my Oracle Linux 6.4 box, sys-unconfig is a script.  I thought this tool did a lot more, but here is the entire contents of the script:



. /etc/init.d/functions

if [ $# -ne 0 ]; then
    echo $"Usage: sys-unconfig" >&2
    exit 1

touch /.unconfigured
rm -f /etc/udev/rules.d/*-persistent-*.rules

On system boot, if /.unconfigured exists, /etc/rc.sysinit does the following:

# Configure machine if necessary.
if [ -f /.unconfigured ]; then

    if [ -x /bin/plymouth ]; then
        /bin/plymouth quit

    if [ -x /usr/bin/system-config-keyboard ]; then
    if [ -x /usr/bin/passwd ]; then
        /usr/bin/passwd root
    if [ -x /usr/sbin/system-config-network-tui ]; then
    if [ -x /usr/sbin/timeconfig ]; then
    if [ -x /usr/sbin/authconfig-tui ]; then
        /usr/sbin/authconfig-tui --nostart
    if [ -x /usr/sbin/ntsysv ]; then
        /usr/sbin/ntsysv --level 35

    # Reread in network configuration data.
    if [ -f /etc/sysconfig/network ]; then
        . /etc/sysconfig/network

        # Reset the hostname.
        action $"Resetting hostname ${HOSTNAME}: " hostname ${HOSTNAME}

    rm -f /.unconfigured

If you don’t implicitly configure any networking the previous configuration would remain.  This could be a bad thing if you rebooted the machine and skipped the setup- it would come up with the same IP and possibly cause issues on the network.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s