[Initng-svn] r2672 - in initng/initfiles: daemon system
svn at initng.thinktux.net
svn at initng.thinktux.net
Mon Jan 2 19:29:38 CET 2006
Author: deac
Date: Mon Jan 2 19:29:37 2006
New Revision: 2672
Modified:
initng/initfiles/daemon/postgres.ii
initng/initfiles/daemon/rp-pppoe.ii
initng/initfiles/system/coldplug.ii
initng/initfiles/system/consolefont.ii
initng/initfiles/system/ifupdown-debian.ii
initng/initfiles/system/initial.ii
initng/initfiles/system/keymaps.ii
Log:
initial: splitted services (please test!); postgres: now a daemon; rp-pppoe: now a daemon (adsl-connect)
Modified: initng/initfiles/daemon/postgres.ii
==============================================================================
--- initng/initfiles/daemon/postgres.ii (original)
+++ initng/initfiles/daemon/postgres.ii Mon Jan 2 19:29:37 2006
@@ -23,18 +23,18 @@
};
}
-service daemon/postgres {
+daemon daemon/postgres {
need = system/bootmisc;
use = daemon/postgres/initdb;
#ifd pingwinek
env DATADIR=/srv/pgsql;
#elsed
- env ATADIR=/var/lib/postgresql/data;
+ env DATADIR=/var/lib/postgresql/data;
#endd
require_network;
suid = postgres;
sgid = postgres;
- exec start = @/usr/bin/pg_ctl@ -D${DATADIR} -p @/usr/bin/postmaster@ -o -p5432 start;
- exec stop = @/usr/bin/pg_ctl@ -D${DATADIR} -s -m fast stop;
pid_of = postmaster;
+ exec daemon = @/usr/bin/pg_ctl@ -D${DATADIR} -p @/usr/bin/postmaster@ -o -p5432 start;
+ exec stop = @/usr/bin/pg_ctl@ -D${DATADIR} -s -m fast stop;
}
Modified: initng/initfiles/daemon/rp-pppoe.ii
==============================================================================
--- initng/initfiles/daemon/rp-pppoe.ii (original)
+++ initng/initfiles/daemon/rp-pppoe.ii Mon Jan 2 19:29:37 2006
@@ -1,6 +1,6 @@
-service daemon/rp-pppoe {
+daemon daemon/rp-pppoe {
need = system/bootmisc;
network_provider;
- exec start = @/usr/sbin/adsl-start@;
+ exec daemon = @/usr/sbin/adsl-connect@;
exec stop = @/usr/sbin/adsl-stop@;
}
Modified: initng/initfiles/system/coldplug.ii
==============================================================================
--- initng/initfiles/system/coldplug.ii (original)
+++ initng/initfiles/system/coldplug.ii Mon Jan 2 19:29:37 2006
@@ -39,6 +39,8 @@
also_stop = system/bootmisc system/coldplug/pci system/coldplug/usb system/coldplug/isapnp system/coldplug/input system/coldplug/ide system/coldplug/scsi;
#endd
use = system/static-modules;
+#ifd unknown_system
+ # this should be done by device-manager
script start = {
# needed to make /dev/input/mice for X
if [ -e /sys/class/input/mice/dev ]
@@ -48,4 +50,5 @@
fi
exit 0
};
+#endd
}
Modified: initng/initfiles/system/consolefont.ii
==============================================================================
--- initng/initfiles/system/consolefont.ii (original)
+++ initng/initfiles/system/consolefont.ii Mon Jan 2 19:29:37 2006
@@ -1,5 +1,5 @@
service system/consolefont {
- need = system/initial system/keymaps;
+ need = system/bootmisc system/keymaps;
#ifd fedora pingwinek
# #elsed WHAT? suse?
# env_file = /etc/sysconfig/i18n;
@@ -14,13 +14,24 @@
exec start = /sbin/setsysfont;
#elsed
script start = {
- if [ -n "${SCREEN_FONT}" ]
+#ifd debian
+ if [ -d /etc/console-tools/config.d ]
then
- CONSOLEFONT=${SCREEN_FONT}
- elif [ -n "${SYSFONT}" ]
+ for i in `@run-parts@ --list /etc/console-tools/config.d`
+ do
+ . ${i}
+ done
+ fi
+ # Different device name for 2.6 kernels and devfs
+ if [ `@uname@ -r | @cut@ -f 2 -d .` = 6 -a -e /dev/.devfsd ]
then
- CONSOLEFONT=${SYSFONT}
+ VCSTIME_OPT="-2 /dev/vcsa0"
+ else
+ VCSTIME_OPT=""
fi
+#endd
+ [ -n "${SCREEN_FONT}" ] && CONSOLEFONT="${SCREEN_FONT}"
+ [ -n "${SYSFONT}" ] && CONSOLEFONT="${SYSFONT}"
if [ -z "${CONSOLEFONT}" ]
then
Modified: initng/initfiles/system/ifupdown-debian.ii
==============================================================================
--- initng/initfiles/system/ifupdown-debian.ii (original)
+++ initng/initfiles/system/ifupdown-debian.ii Mon Jan 2 19:29:37 2006
@@ -28,7 +28,7 @@
if [ -d "${dest}" ]
then
cd "${dest}"
- dest=$(@/bin/pwd@)
+ dest=`@/bin/pwd@`
break
fi
Modified: initng/initfiles/system/initial.ii
==============================================================================
--- initng/initfiles/system/initial.ii (original)
+++ initng/initfiles/system/initial.ii Mon Jan 2 19:29:37 2006
@@ -1,18 +1,20 @@
service system/initial/mountvirtfs {
critical;
script start = {
+ # test, if all necasary directories exists.
for dir in /proc /dev /sys
do
- if [ ! -d ${dir} ]
+ if [ ! -d ${dir} ] # no?
then
echo "The dir \"${dir}\" is missing, cant mount it!" >&2
echo "Please sulogin, remount rw and create them." >&2
- exit 1
+ exit 1 # we can't work. critical!
fi
done
mount -n -t proc proc /proc &
mount -n -t sysfs sys /sys &
+ # we need /dev/null direct, so we create it by hand.
{ mount -n -o size=10M,mode=0755 -t tmpfs udev /dev && \
@rm@ -f /dev/null && \
@mknod@ /dev/null c 1 3 -m 666
@@ -23,50 +25,12 @@
};
}
-# udevd to handle udev requests
-daemon system/initial/udev {
+service system/initial/udev/start {
+ # /dev should exist.
need = system/initial/mountvirtfs;
- respawn;
- pid_of = udevd;
- script daemon = {
-
- # Make sure hotplug is not missing.
- if [ ! -e /proc/sys/kernel/hotplug ]
- then
- echo "/proc/sys/kernel/hotplug is missing!"
- fi
-
- # we kill it, because udevd can run only once
- @killall@ udevd || @true@ &> /dev/null
-
- #create som .udev stuff
- @mkdir@ -p /dev/.udev
-
- # Setup hotplugging (if possible)
- echo "@/sbin/udevsend:/sbin/hotplug:/sbin/udev@" > /proc/sys/kernel/hotplug
-
- # Launch udevd
- exec @/sbin/udevd@ --daemon;
- }
-
- #script stop = {
- # @rm@ /dev/.udev
- # # Disable hotplug requests
- # echo "" > /proc/sys/kernel/hotplug
- #};
-}
-
-# fill the /dev with all devices system have
-service system/initial/filldev {
- need = system/initial/mountvirtfs system/initial/udev;
- critical;
+#ifd unknown_system
script start = {
- echo "Mounting devpts at /dev/pts ..."
- @mkdir@ -p /dev/pts && @mount@ -n -t devpts -o gid=5,mode=0620 none /dev/pts &
-
- echo "Mounting devshm at /dev/shm ..."
- @mkdir@ -p /dev/shm && @mount@ -n -t tmpfs none /dev/shm &
-
+ # which system needs this?
if [ -e /etc/udev/links.conf ]
then
echo "Parsing /etc/udev/links.conf ..."
@@ -83,6 +47,7 @@
done
fi
+ # and this?
# A complete dir to copy
if [ -d /lib/udev/devices ]
then
@@ -90,7 +55,8 @@
# Copy over default device tree
(cd /lib/udev/devices && @find@ -print0 | @cpio@ --quiet -0pmdu /dev) &
fi
-
+
+ # and this?
# If no-one abow work
if [ ! -e /etc/udev/links.conf -a ! -d /lib/udev/devices ]
then
@@ -102,16 +68,13 @@
@ln@ -snf /proc/kcore /dev/core &
@ln@ -snf /proc/asound/oss/sndstat /dev/sndstat &
fi
-
- [ ! -e /dev/MAKEDEV -a @/sbin/MAKEDEV@ ] && \
- @ln@ -fs @/sbin/MAKEDEV@ /dev/MAKEDEV &
- wait
-
+ # which system provides udevsynthesize? gentoo does not.
+ # and which provides udevplug? gentoo does not, too.
+
# run syntesizers that will make hotplug events for every
# devices that is currently in the computer, that will
# create all dev files.
-
if [ -x "@/sbin/udevsynthesize@" ]
then
udevd_timeout=30
@@ -136,29 +99,75 @@
done
elif [ -x "@/sbin/udevplug@" ]
then
- @/sbin/udevplug@
+ exec @/sbin/udevplug@
elif [ -x "@/sbin/udevstart@" ]
then
- @/sbin/udevstart@
+ exec @/sbin/udevstart@
fi
+#elsed
+ # gentoo provides only udevstart, so we use it only.
+ exec start = @/sbin/udevstart@;
+#endd
+}
- exit 0
+# udevd to handle udev requests
+daemon system/initial/udev {
+ # first we must run udevstart or something like, because, it will kill our udevd.
+ # btw: we kill all udevd, which runs before.
+ need = system/initial/mountvirtfs system/initial/udev/start;
+ respawn;
+ pid_of = udevd;
+ script daemon = {
+ # Make sure hotplug is not missing.
+ # and what is, if we know it?
+ [ -e /proc/sys/kernel/hotplug ] || echo "/proc/sys/kernel/hotplug is missing!"
+
+ # we kill it, because udevd can run only once
+ # system/initial/udev/start starts udevd too, so we must kill it.
+ @killall@ udevd >/dev/null 2>&1
+
+ # Setup hotplugging (if possible)
+ echo "@/sbin/udevsend:/sbin/hotplug:/sbin/udev@" >/proc/sys/kernel/hotplug
+
+ # Launch udevd
+ exec @/sbin/udevd@ --daemon;
+ }
+
+ script stop = {
+ # every new hotplug-event can do something wrong.
+ echo "" >/proc/sys/kernel/hotplug
};
}
-service system/initial {
- need = system/initial/mountvirtfs system/initial/udev system/initial/filldev;
- use = system/selinux/dev;
- critical;
+# fill the /dev with all devices system have
+service system/initial/filldev {
+ need = system/initial/mountvirtfs; # it doesn't need system/initial/udev
+ critical; # this script can't be fail.
script start = {
- # Set the console loglevel to 1 for a cleaner boot
- # the logger should anyhow dump the ring-0 buffer at start to the
- # logs, and that with dmesg can be used to check for problems
- @/sbin/dmesg@ -n 1
- };
+ echo "Mounting devpts at /dev/pts ..."
+ @mkdir@ -p /dev/pts && @mount@ -n -t devpts -o gid=5,mode=0620 none /dev/pts &
- script stop = {
- # Increase the debug level a bit
- @/sbin/dmesg@ -n 2
+ echo "Mounting devshm at /dev/shm ..."
+ @mkdir@ -p /dev/shm && @mount@ -n -t tmpfs none /dev/shm &
+
+ [ ! -e /dev/MAKEDEV -a @/sbin/MAKEDEV@ ] && \
+ @ln@ -fs @/sbin/MAKEDEV@ /dev/MAKEDEV &
+
+ wait
+ exit 0
};
}
+
+service system/initial/loglevel {
+ # Set the console loglevel to 1 for a cleaner boot
+ # the logger should anyhow dump the ring-0 buffer at start to the
+ # logs, and that with dmesg can be used to check for problems
+ exec start = @/sbin/dmesg@ -n 1;
+ # Increase the debug level a bit
+ exec stop = @/sbin/dmesg@ -n 2;
+}
+
+virtual system/initial {
+ need = system/initial/loglevel system/initial/mountvirtfs system/initial/udev system/initial/filldev;
+ use = system/selinux/dev;
+}
Modified: initng/initfiles/system/keymaps.ii
==============================================================================
--- initng/initfiles/system/keymaps.ii (original)
+++ initng/initfiles/system/keymaps.ii Mon Jan 2 19:29:37 2006
@@ -89,18 +89,12 @@
# unmount /proc if we mounted it
[ "${unmount_proc}" = "no" ] || @/bin/umount@ -n /proc
#elsed
-
if [ -e /etc/console/boottime.kmap.gz ]
then
@/bin/loadkeys@ -q /etc/console/boottime.kmap.gz >/dev/null 2>&1
exit 0
fi
- # if is_uml_sys
- # echo "Loading key mappings"
- # return 0
- # fi
-
WINDOWKEYS_KEYMAP=
# Force linux keycodes for PPC.
@@ -126,15 +120,15 @@
[ -n "${DUMPKEYS_CHARSET}" ] && dumpkey_opts="-c ${DUMPKEYS_CHARSET}"
@/usr/bin/kbd_mode@ -u
@dumpkeys@ ${dumpkey_opts} | loadkeys --unicode
- termencoding='\033%G'
+ termencoding=`@printf@ '\033%G'`
else
- termencoding='\033(K'
+ termencoding=`@printf@ '\033(K'`
fi
[ -d /dev/vc ] && ttydev=/dev/vc/ || ttydev=/dev/tty
for n in `@seq@ 1 11`
do
- echo -n -e ${termencoding} >${ttydev}${n}
+ echo -n ${termencoding} >${ttydev}${n}
done
#endd
};
More information about the Initng-svn
mailing list