From dda7c6356e2c175ecf37876919afc4455a3a3155 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Tue, 9 Mar 2010 22:22:16 +0100 Subject: Playing around with /etc/init/* stuff of Ubuntu 10.04 ... --- initramfs/distro-specs/ubuntu/functions-default | 96 ++++++++++++++----------- 1 file changed, 56 insertions(+), 40 deletions(-) (limited to 'initramfs/distro-specs/ubuntu/functions-default') diff --git a/initramfs/distro-specs/ubuntu/functions-default b/initramfs/distro-specs/ubuntu/functions-default index f9d7b113..919ab33f 100644 --- a/initramfs/distro-specs/ubuntu/functions-default +++ b/initramfs/distro-specs/ubuntu/functions-default @@ -45,19 +45,26 @@ config_distro () { done # remove unneeded init scripts (stuff handled in stage3 which would # interface with already existing setup) - for file in bridge-network-interface.conf hostname.conf network-manager.conf \ - ureadahead*conf ; - do rm /mnt/etc/init/${file} >/dev/null 2>&1 + # copy all event scripts to a special directory + testmkd /mnt/etc/init.inactive + mv /mnt/etc/init/* /mnt/etc/init.inactive + # copy initial upstart scripts back + for file in alsa-mixer-save.conf control-alt-delete.conf dbus.conf \ + dmesg.conf hwclock.conf hwclock-save.conf irqbalance.conf \ + module-init-tools.conf mountall.conf plymouth*conf \ + procps.conf rc.conf rcS.conf tty*conf udev*conf \ + upstart-ufw-bridge.conf ; do + mv /mnt/etc/init.inactive/${file} /mnt/etc/init >/dev/null 2>&1 done # add the halt link to the 0 and 6 runlevel directories and other useful # links - ln -sf ../init.d/halt /mnt/etc/rc0.d/S90halt - ln -sf ../init.d/reboot /mnt/etc/rc6.d/S90reboot - ln -sf ../init.d/single /mnt/etc/rc1.d/S90single - for dir in rc2.d rc3.d rc4.d rc5.d; do - ln -sf ../init.d/rc.local /mnt/etc/${dir}/S99rc.local - done + #ln -sf ../init.d/halt /mnt/etc/rc0.d/S90halt + #ln -sf ../init.d/reboot /mnt/etc/rc6.d/S90reboot + #ln -sf ../init.d/single /mnt/etc/rc1.d/S90single + #for dir in rc2.d rc3.d rc4.d rc5.d; do + # ln -sf ../init.d/rc.local /mnt/etc/${dir}/S99rc.local + #done # remove annoying udev rule set for changing eth interface and cd/dvds rm /mnt/etc/udev/rules.d/*persistent*.rules >/dev/null 2>&1 @@ -89,7 +96,7 @@ if [ -f /mnt/etc/init.d/ntp -a "x$start_ntp" != "xno" ] ; then echo -e "ntp:x:74:65534:NTP daemon:/var/lib/ntp:/bin/false" \ >>/mnt/etc/passwd testmkd /mnt/var/lib/ntp/var/run/ntp - : + fi } # function for atd @@ -98,14 +105,18 @@ if [ "x$start_atd" = "xyes" ]; then # testmkd /mnt/var/spool/atjobs # testmkd /mnt/var/spool/atspool # chown 1:1 /mnt/var/spool/atjobs /mnt/var/spool/atspool - : + if [ -f /mnt/etc/init.inactive/atd ] ; then + mv /mnt/etc/init.inactive/atd /mnt/etc/init + else + error "$df_erratd" nonfatal + fi fi } # function for configuration of cron services (fixme: to be moved to a plugin?) config_cron () { if [ "x$start_cron" = "xyes" ] ; then - if [ -f /mnt/etc/init.d/cron ] ; then - : + if [ -f /mnt/etc/init.inactive/anacron ] ; then + mv /mnt/etc/init.inactive/anacron /mnt/etc/init # fixme! check for proper permissions! testmkd /mnt/var/spool/crontabs echo -e "# /etc/crontab - file generated by $0:\n\ @@ -120,30 +131,36 @@ fi # secure shell service config_sshd () { if [ "x$start_sshd" = "xyes" ] ; then - if [ -f /mnt/etc/init.d/ssh ] ; then - #testmkd /mnt/var/run/sshd - : + if [ -f /mnt/etc/init.inactive/ssh.conf ] ; then + testmkd /mnt/var/run/sshd + mv /mnt/etc/init.inactive/ssh.conf /mnt/etc/init else error "$df_errsshd" nonfatal fi fi } -# snmp agent for remote monitoring +# snmp agent for remote monitoring (upstart functionality unchecked) config_snmp () { if [ "x$start_snmp" = "xyes" ] ; then - if [ -f /mnt/etc/init.d/snmpd ] ; then - : + if [ -f /mnt/etc/init.inactive/snmpd.conf ] ; then testmkd /mnt/var/lib/net-snmp - fi + mv /mnt/etc/init.inactive/snmpd.conf /mnt/etc/init + else # fixme!! # write service monitor depending on services started + : fi +fi } # acpi and powersave config_acpi () { - : - #Commented out since battery checking is only useful for Notebooks - #rllinker "acpi-support" 99 2 + if [ -f /mnt/etc/init.inactive/acpid.conf ] ; then + mv /mnt/etc/init.inactive/acpid.conf /mnt/etc/init + else + # fixme!! + # write service monitor depending on services started + : + fi } # configure hal, dbus, policykitd and services like that config_dreshal () { @@ -163,14 +180,9 @@ if [ "x$start_dreshal" = "xyes" ]; then -e "s/@@return@@/ /" sed -i /mnt/etc/dbus-1/system.d/hal.conf \ -e "s/^\([^d]*\)deny\(.*Volume.*\)/\1allow\2/" - : - : - 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 - : - fi + for dir in 10-vendor.d 20-org.d 30-site.d 50-local.d 90-mandatory.d ; do + testmkd /mnt/var/lib/polkit-1/localauthority/${dir} + done fi } @@ -201,9 +213,10 @@ rerun\n# the mkdxsinitrd script to get them applied\n\n\ ;; esac } -# configure automounter +# configure automounter (unchecked) config_automount () { -if [ -f /mnt/etc/init.d/autofs ] ; then +if [ -f /mnt/etc/init.inactive/autofs.conf ] ; then + mv /mnt/etc/init.inactive/autofs.conf /mnt/etc/init testmkd /mnt/var/lock/subsys sed -e "1i# /etc/default/autofs - file modified by\n#\t$0:\n#" \ -e "s,TIMEOUT.*,TIMEOUT=60," -i /mnt/etc/default/autofs @@ -212,20 +225,23 @@ fi } # start portmapper (needed at least for nfsN and nis services) config_portmap () { - : + mv /mnt/etc/init.inactive/portmap.conf /mnt/etc/init + mv /mnt/etc/init.inactive/statd.conf /mnt/etc/init } -# start NIS (fixme - does the service is really named ypbind??) +# start NIS (unchecked!! fixme - does the service is really named ypbind??) config_nis () { - if [ -f /mnt/etc/init.d/ypbind ] ; then + if [ -f /mnt/etc/init.inactive/ypbind.conf ] ; then + mv /mnt/etc/init.inactive/ypbind.conf /mnt/etc/init config_portmap testmkd /mnt/var/yp/nicknames else error "$df_erryp" nonfatal fi } -# name service caching daemon (useful in most cases) +# name service caching daemon (really existing!?) config_nscd () { - if [ -f /mnt/etc/init.d/nscd ] ; then - testmkd /mnt/var/cache/nscd - fi + #if [ -f /mnt/etc/init.inactive/nscd.conf ] ; then + # testmkd /mnt/var/cache/nscd + #fi + : } -- cgit v1.2.3-55-g7522