From 84cf2cdc136bea14895d535c78114b8e86463df0 Mon Sep 17 00:00:00 2001 From: build Date: Tue, 13 Feb 2007 16:35:25 +0000 Subject: [PATCH] creation - various custom files for myplc{,-devel} --- myplc-devel-tuning/build-profile | 6 + myplc-devel-tuning/init-d-plc-devel | 173 ++++++++++++++++++++++++++++ myplc-devel-tuning/root-profile | 6 + myplc-devel-tuning/yum.conf | 33 ++++++ myplc-tuning/dot-profile | 6 + myplc-tuning/yum.conf | 33 ++++++ 6 files changed, 257 insertions(+) create mode 100644 myplc-devel-tuning/build-profile create mode 100755 myplc-devel-tuning/init-d-plc-devel create mode 100644 myplc-devel-tuning/root-profile create mode 100644 myplc-devel-tuning/yum.conf create mode 100644 myplc-tuning/dot-profile create mode 100644 myplc-tuning/yum.conf diff --git a/myplc-devel-tuning/build-profile b/myplc-devel-tuning/build-profile new file mode 100644 index 0000000..e11e340 --- /dev/null +++ b/myplc-devel-tuning/build-profile @@ -0,0 +1,6 @@ +export PS1=" $PS1" +alias d=dirs +alias g=pushd +alias b=popd +alias j=jobs +alias h=history diff --git a/myplc-devel-tuning/init-d-plc-devel b/myplc-devel-tuning/init-d-plc-devel new file mode 100755 index 0000000..88dcffe --- /dev/null +++ b/myplc-devel-tuning/init-d-plc-devel @@ -0,0 +1,173 @@ +#!/bin/bash +# +# plc Manages all PLC services on this machine +# +# chkconfig: 2345 99 5 +# +# description: Manages all PLC services on this machine +# +# $Id: host.init,v 1.7.2.4 2006/08/21 21:21:11 mlhuang Exp $ +# + +PATH=/sbin:/bin:/usr/bin:/usr/sbin + +# Source function library. +if [ -f /etc/init.d/functions ] ; then + . /etc/init.d/functions +fi + +# If success() or failure() are not defined +if ! type -type success >/dev/null || ! type -type failure >/dev/null ; then + success() { + echo -ne "[ OK ]\r" + return 0 + } + failure() { + echo -ne "[FAILED]\r" + return 1 + } +fi + +# Source configuration +SERVICE=$(basename $0) +if [ ! -f /etc/sysconfig/$SERVICE ] ; then + SERVICE=plc +fi +if [ -f /etc/sysconfig/$SERVICE -a -z "${PLC_ROOT}${PLC_DATA}" ] ; then + . /etc/sysconfig/$SERVICE +fi + +# Total number of errors +ERRORS=0 + +# Count the exit status of the last command +check () +{ + ERRORS=$(($ERRORS+$?)) +} + +mounted () +{ + if cut -d' ' -f2 /proc/mounts | grep -q "$1" ; then + return 0 + else + return 1 + fi +} + +mount_plc () +{ + echo -n $"Mounting PLC: " + + if ! mounted $PLC_ROOT ; then + if ! e2fsck -a $PLC_ROOT.img | logger -t "PLC" ; then + e2fsck $PLC_ROOT.img + fi + mount -o loop $PLC_ROOT.img $PLC_ROOT + check + fi + if ! mounted $PLC_ROOT/data ; then + mount -t none -o bind,rw $PLC_DATA $PLC_ROOT/data + check + fi + if [ -d /data/fedora ] ; then + if ! mounted $PLC_ROOT/data/fedora ; then + mount -t none -o bind,ro /data/fedora $PLC_ROOT/data/fedora + check + fi + if [ -d /svn ] ; then + if ! mounted $PLC_ROOT/svn ; then + mount -t none -o bind,ro /svn $PLC_ROOT/svn + check + fi + fi + if ! mounted $PLC_ROOT/proc ; then + mount -t proc none $PLC_ROOT/proc + check + fi + + [ $ERRORS -eq 0 ] && success $"PLC unmount" || failure $"PLC unmount" + echo + +} + +start () +{ + # Starting everything + if [ -z "$1" ] ; then + mount_plc + fi + + chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS start $* + check +} + +umount_plc () +{ + echo -n $"Unmounting PLC: " + + for dir in $PLC_ROOT/proc $PLC_ROOT/data/fedora $PLC_ROOT/svn $PLC_ROOT/data $PLC_ROOT ; do + if mounted $dir ; then + umount $dir + check + fi + done + + [ $ERRORS -eq 0 ] && success $"PLC unmount" || failure $"PLC unmount" + echo +} + +stop () +{ + if mounted $PLC_ROOT ; then + chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS stop $* + check + fi + + # Stopped everything + if [ -z "$1" ] ; then + umount_plc + fi +} + +mountstatus_plc () +{ + for dir in $PLC_ROOT/proc $PLC_ROOT/data/fedora$PLC_ROOT/svn $PLC_ROOT/data $PLC_ROOT ; do + if mounted $dir ; then + echo $dir + fi + done +} + +# Get command +shift $(($OPTIND - 1)) +command=$1 + +# Get step(s) +shift 1 + +case "$command" in + start|stop) + $command $* + ;; + + restart) + stop $* + start $* + ;; + + reload) + chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS reload $* + ;; + + mount|umount|mountstatus) + ${command}_plc $* + ;; + + *) + echo "Usage: $0 {start|stop|restart|reload|mount|umount|mountstatus}" + RETVAL=1 + ;; +esac + +exit $ERRORS diff --git a/myplc-devel-tuning/root-profile b/myplc-devel-tuning/root-profile new file mode 100644 index 0000000..1975bb9 --- /dev/null +++ b/myplc-devel-tuning/root-profile @@ -0,0 +1,6 @@ +export PS1=" $PS1" +alias d=dirs +alias g=pushd +alias b=popd +alias j=jobs +alias h=history diff --git a/myplc-devel-tuning/yum.conf b/myplc-devel-tuning/yum.conf new file mode 100644 index 0000000..9273071 --- /dev/null +++ b/myplc-devel-tuning/yum.conf @@ -0,0 +1,33 @@ +[main] +cachedir=/var/cache/yum +debuglevel=2 +logfile=/var/log/yum.log +pkgpolicy=newest +distroverpkg=redhat-release +tolerant=1 +exactarch=1 +retries=20 +obsoletes=1 +gpgcheck=0 +# Prevent yum-2.4 from loading additional repository definitions +# (e.g., from /etc/yum.repos.d/) +reposdir=/dev/null + +[base] +name=Fedora Core 4 - i386 - base +baseurl=file:///data/fedora/linux/core/4/i386/os/ + + +[updates] +name=Fedora Core 4 - i386 - updates +baseurl=file:///data/fedora/linux/core/updates/4/i386/ + + +[extras] +name=Fedora Core 4 - i386 - extras +baseurl=file:///data/fedora/linux/extras/4/i386/ + + +#[bootstrap] +#name=Bootstrap - i386 - /home/build/build/nightly/2007.01.24/RPMS/ +#baseurl=file:///home/build/build/nightly/2007.01.24/RPMS/ diff --git a/myplc-tuning/dot-profile b/myplc-tuning/dot-profile new file mode 100644 index 0000000..a160f73 --- /dev/null +++ b/myplc-tuning/dot-profile @@ -0,0 +1,6 @@ +export PS1=" $PS1" +alias d=dirs +alias g=pushd +alias b=popd +alias j=jobs +alias h=history diff --git a/myplc-tuning/yum.conf b/myplc-tuning/yum.conf new file mode 100644 index 0000000..5c19937 --- /dev/null +++ b/myplc-tuning/yum.conf @@ -0,0 +1,33 @@ +[main] +cachedir=/var/cache/yum +debuglevel=2 +logfile=/var/log/yum.log +pkgpolicy=newest +distroverpkg=redhat-release +tolerant=1 +exactarch=1 +retries=20 +obsoletes=1 +gpgcheck=0 +# Prevent yum-2.4 from loading additional repository definitions +# (e.g., from /etc/yum.repos.d/) +reposdir=/dev/null + +[base] +name=Fedora Core 4 - i386 - base +baseurl=http://onelab-build.inria.fr/fedora/linux/core/4/i386/os/ + + +[updates] +name=Fedora Core 4 - i386 - updates +baseurl=http://onelab-build.inria.fr/fedora/linux/core/updates/4/i386/ + + +[extras] +name=Fedora Core 4 - i386 - extras +baseurl=http://onelab-build.inria.fr/fedora/linux/extras/4/i386/ + + +#[bootstrap] +#name=Bootstrap - i386 - /home/build/build/nightly/2007.01.18.1/RPMS/ +#baseurl=file:///home/build/build/nightly/2007.01.18.1/RPMS/ -- 2.43.0