From a565a05eb344a330a22a7928deedeced3c3b77e8 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Fri, 29 Aug 2008 23:45:34 +0000 Subject: Some more cleanup in stage3. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2150 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/distro-specs/suse/functions-default | 20 ++----- initramfs/distro-specs/ubuntu/functions-default | 80 +++++++------------------ initramfs/stage3-stuff/bin/servconfig | 2 +- initramfs/stage3-stuff/init | 4 +- 4 files changed, 29 insertions(+), 77 deletions(-) (limited to 'initramfs') diff --git a/initramfs/distro-specs/suse/functions-default b/initramfs/distro-specs/suse/functions-default index 78a55064..6c7db1f6 100644 --- a/initramfs/distro-specs/suse/functions-default +++ b/initramfs/distro-specs/suse/functions-default @@ -391,23 +391,11 @@ if [ "x$start_cron" = "xyes" ] ; then fi fi } -# syslog service (use syslog-ng for all versions) -config_syslog () { -if [ "x$start_syslog" != "xno" ] ; then - # enable basic logging to console tty10; file logging could be enabled via - # setting of config_syslog="file" - start_syslog="yes" - if [ -f /mnt/etc/init.d/syslog ] ; then - sed -e "1i# modified in InitRamFS by $0" \ - -e "s,SYSLOG_DAEMON=.*,SYSLOG_DAEMON=\"syslog-ng\"," \ - -i /mnt/etc/sysconfig/syslog - # logoutput depending on $start_syslog definitions - sysngwriter /mnt/etc/syslog-ng/syslog-ng.conf - rllinker syslog 2 20 - else - error "$df_errsysl" nonfatal +# name service caching daemon (useful in most cases) +config_nscd () { + if [ -f /mnt/etc/init.d/nscd ] ; then + rllinker "nscd" 20 5 fi -fi } # secure shell service config_sshd () { diff --git a/initramfs/distro-specs/ubuntu/functions-default b/initramfs/distro-specs/ubuntu/functions-default index 325d1335..95b70258 100644 --- a/initramfs/distro-specs/ubuntu/functions-default +++ b/initramfs/distro-specs/ubuntu/functions-default @@ -117,6 +117,7 @@ sed "s/LANG.*/LANG=\"${LANG}\"/" -i /mnt/etc/default/locale # group of functions for the normal runlevels - first parameter is start # second stop + # function for ntp configuration config_ntp () { if [ -f /mnt/etc/init.d/ntp -a "x$start_ntp" != "xno" ] ; then @@ -126,7 +127,6 @@ if [ -f /mnt/etc/init.d/ntp -a "x$start_ntp" != "xno" ] ; then rllinker "ntp" 7 14 fi } - # function for atd config_atd () { if [ "x$start_atd" = "xyes" ]; then @@ -136,7 +136,6 @@ if [ "x$start_atd" = "xyes" ]; then rllinker "atd" 14 4 fi } - # function for configuration of cron services (fixme: to be moved to a plugin?) config_cron () { if [ "x$start_cron" = "xyes" ] ; then @@ -153,28 +152,6 @@ if [ "x$start_cron" = "xyes" ] ; then fi fi } - -# syslog service (available as a plugin, to be deleted here) -config_syslog () { -if [ "x$start_syslog" != "xno" ] ; then -# fixme, welcher Syslog wird verwendet? -#if syslog - testmkd /mnt/var/log/news - echo -e "# /etc/syslog.conf - file generated by $0" >/mnt/etc/syslog.conf -# test -n "$log_servers" && \ -# for logserver in $log_servers; do -# echo -e "*.*;*.*;*.*;*kern.!*\t@$logserver" >>/mnt/etc/syslog.conf -# done -#else syslog-ng -# if [ -f /mnt/etc/init.d/syslog ] ; then -# # logoutput depending on $start_syslog definitions -# sysngwriter /mnt/etc/syslog-ng/syslog-ng.conf - rllinker "sysklogd" 2 18 -#else keiner installiert -# error "$df_errsysl" nonfatal -fi -} - # secure shell service config_sshd () { if [ "x$start_sshd" = "xyes" ] ; then @@ -186,7 +163,6 @@ if [ "x$start_sshd" = "xyes" ] ; then fi fi } - # snmp agent for remote monitoring config_snmp () { if [ "x$start_snmp" = "xyes" ] ; then @@ -198,27 +174,23 @@ if [ "x$start_snmp" = "xyes" ] ; then # write service monitor depending on services started fi } - # acpi and powersave config_acpi () { rllinker "acpid" 10 19 #Commented out since battery checking is only useful for Notebooks #rllinker "acpi-support" 99 2 - - # nur hier weil udev_hotplug zu früh aufgerufen wird. -> Hm, warum zu - # früh an der anderen Stelle - was fehlt?? udev_hotplug gibts im Stage3 - # nicht mehr!! - rllinker "udev" 11 25 } - # configure hal, dbus, policykitd and services like that config_dreshal () { if [ "x$start_dreshal" = "xyes" ]; then testmkd /mnt/var/lib/dbus rllinker "dbus" 17 20 - - testmkd /mnt/var/lib/PolicyKit root:polkituser 1770 - testmkd /mnt/var/lib/PolicyKit-public root:polkituser + if [ ! -e /mnt/etc/init.d/policykit ] ; then + testmkd /mnt/var/lib/PolicyKit root:polkituser 1770 + testmkd /mnt/var/lib/PolicyKit-public root:polkituser + else + rllinker "policykit" 18 10 + fi fi } @@ -245,7 +217,6 @@ rerun\n# the mkdxsinitrd script to get them applied\n\n\ ;; esac } - # configure automounter config_automount () { if [ -f /mnt/etc/init.d/autofs ] ; then @@ -256,30 +227,23 @@ if [ -f /mnt/etc/init.d/autofs ] ; then rllinker "autofs" 12 4 fi } -# config nfsv4 -config_nfsv4 () { -if [ "x$start_nfsv4" = "xyes" ]; then - testmkd /mnt/var/lib/nfs/rpc_pipefs - testmkd /mnt/var/lib/nfs/sm - sed -e "s,NEED_IDMAPD=.*,NEED_IDMAPD=\"yes\"," \ - -e "s,NEED_GSSD=.*,NEED_GSSD=\"yes\"," \ - -i /mnt/etc/default/nfs-common - echo -e "rpc_pipefs\t/var/lib/nfs/rpc_pipefs rpc_pipefs defaults\t 0 0\n\ -nfsd\t\t/proc/fs/nfsd\tnfsd\t\tdefaults\t 0 0" >>/tmp/fstab -echo -e "\t# stuff needed for nfsv4\n\tmount -t rpc_pipefs rpc_pipefs \ -/var/lib/nfs/rpc_pipefs\n\tmount -t nfsd nfsd /proc/fs/nfsd" \ ->>/mnt/etc/init.d/boot.slx - # portmap is required for any NFS - config_portmap - rllinker "nfs-common" 10 8 -fi -} -# start portmapper (needed at least for nfs and nis services) +# start portmapper (needed at least for nfsN and nis services) config_portmap () { rllinker "portmap" 2 20 } - -# start NIS (fixmee - does the service is really named ypbind??) +# start NIS (fixme - does the service is really named ypbind??) config_nis () { - rllinker "ypbind" 6 16 + if [ -f /mnt/etc/init.d/ypbind ] ; then + rllinker "ypbind" 6 16 + config_portmap + testmkd /mnt/var/yp/nicknames + else + error "$df_erryp" nonfatal + fi +} +# name service caching daemon (useful in most cases) +config_nscd () { + if [ -f /mnt/etc/init.d/nscd ] ; then + rllinker "nscd" 20 5 + fi } diff --git a/initramfs/stage3-stuff/bin/servconfig b/initramfs/stage3-stuff/bin/servconfig index f0396b8d..a3c777d4 100755 --- a/initramfs/stage3-stuff/bin/servconfig +++ b/initramfs/stage3-stuff/bin/servconfig @@ -238,7 +238,7 @@ config_samba ############################################################################# # NIS (variable typically fetched via dhcp) # setup nis configuration if needed -if [ "x$nis_domain" != "x" ] && [ "x$nis_servers" != "x" ] ; then +if [ "x$nis_domain" != "x" -a "x$nis_servers" != "x" ] ; then echo $nis_domain >/mnt/etc/defaultdomain echo -e "# /etc/yp.conf - file generated by $0:\n#\t\ $date\n\nypserver "$nis_servers >/mnt/etc/yp.conf diff --git a/initramfs/stage3-stuff/init b/initramfs/stage3-stuff/init index 1cbee587..88820b86 100755 --- a/initramfs/stage3-stuff/init +++ b/initramfs/stage3-stuff/init @@ -17,7 +17,7 @@ # fixme: shut down if script fails - this does not really work in case of # script crash trap "exec (sleep 30; echo o>/proc/sysrq-trigger)" \ - SIGHUP SIGINT SIGPIPE SIGTERM + SIGHUP SIGINT SIGPIPE SIGTERM SIGKILL # device files get their own filesystem (to be move mounted later) devdir="/dev" @@ -367,7 +367,7 @@ else # useless if [ -z "$bootmac" ] ; then bootmac="$macaddr" - error "$init_bootmac" nonfatal + [ "$ethif" != "eth0" ] && error "$init_bootmac" nonfatal fi if [ "$macaddr" = "$bootmac" ] ; then nwif=$ethif -- cgit v1.2.3-55-g7522