firstboot program configuration script on Linux Fedora 9



Computer Configuration for GNU Linux Fedora using Linux Command

 

   The firstboot configuration script below is located under the /etc/rc.d/init.d directory.  This firstboot script contains the start up configuration for firstboot program.  The firstboot program is the Fedora system configuration that usually run after finish the installation process.  The firstboot program can be run to reconfigure Fedora system if you need to reconfigure Fedora like after fresh installation.

Fedora Linux firstboot Script File Location:

/etc/rc.d/init.d/firstboot

 

Short Description:   Starts the firstboot configuration program

Description:   Firstboot runs the first time a machine is booted after installation. It checks for the existence of an /etc/sysconfig/firstboot file. If the file exists and contains RUN_FIRSTBOOT=NO, firstboot will not run. Otherwise firstboot will be run. If /etc/reconfigSys exists or if "reconfig" is provided in the kernel boot arguments, firstboot will run in reconfiguration mode.

 

Using cat command to view the contents of firstboot configuration script file:

View firstboot program script using cat command

[root@fedora ~]# cat /etc/rc.d/init.d/firstboot

#!/bin/bash

## BEGIN INIT INFO

# Provides: firstboot

# Default-Start: 3 5

# Default-Stop: 0 1 2 4 6

# Required-Start:

# Should-Start: $network

# Short-Description: Starts the firstboot configuration program

# Description: Firstboot runs the first time a machine is booted after

# installation. It checks for the existance of an

# /etc/sysconfig/firstboot file. If the file exists and

# contains RUN_FIRSTBOOT=NO, firstboot will not run. Otherwise

# firstboot will be run. If /etc/reconfigSys exists or if

# "reconfig" is provided in the kernel boot arguments,

# firstboot will run in reconfiguration mode.

## END INIT INFO

 

#

# firstboot: Starts the firstboot druid if it hasn't been run before

#

# chkconfig: 35 99 95

#

# description: Firstboot is a druid style program that runs on the first \

# time a machine is booted after install. It checks for \

# the existence of an /etc/sysconfig/firstboot file. If \

# the file exists and contains RUN_FIRSTBOOT=NO, firstboot \

# will not run. Otherwise, firstboot will be run. \

# If /etc/reconfigSys exists or if "reconfig" is provided \

# in the kernel boot arguments, firstboot will run in \

# reconfiguration mode.

#

 

# Source function library.

. /etc/init.d/functions

 

FILENAME=/etc/sysconfig/firstboot

 

[ -z "$HOME" ] && export HOME=/

 

case "$1" in

start)

args=""

 

if [ -f $FILENAME ] && [ ! -z "$(grep 'RUN_FIRSTBOOT=NO' $FILENAME)" ]; then

exit 0

fi

 

if grep -i "reconfig" /proc/cmdline >/dev/null || [ -f /etc/reconfigSys ]; then

args="--reconfig"

fi

 

# If X isn't running but the default runlevel is 5, start s-c-display

# to configure X. After that, firstboot can run.

runlevel=$(set -- $(runlevel); eval "echo \$$#")

 

if grep -q "^id:5:initdefault:" /etc/inittab && [ "$runlevel" = "5" ]; then

. /etc/sysconfig/i18n

 

if [ ! -f /etc/X11/xorg.conf ] && [ ! -f /etc/X11/XF86Config ]; then

echo -n $"X is not configured. Running system-config-display."

/usr/bin/system-config-display

echo -n $"X is now configured. Starting firstboot."

fi

fi

 

/usr/sbin/firstboot $args

RETVAL=$?

 

# If firstboot succeeded, chkconfig it off so we don't see the message

# in rhgb every time about starting up firstboot.

if [ "$RETVAL" -eq 0 ]; then

action "" /bin/true

/sbin/chkconfig firstboot off

else

action "" /bin/false

fi

 

exit $RETVAL

;;

 

stop)

exit 0

;;

 

*)

echo $"Usage: $0 {start|stop}"

exit 3

;;

esac

[root@fedora ~]#

 

Use ls -l command to show the firstboot script file permission, owner, group owner, file size, date created or edited and file location.

View firstboot script file permission using ls command

[root@fedora ~]# ls -l /etc/rc.d/init.d/firstboot

-rwxr-xr-x 1 root root 2875 2008-04-16 08:01 /etc/rc.d/init.d/firstboot

[root@fedora ~]#

 




0 comments: