From d8796827633d533e53ba7e158ee6354c38d0e88e Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Sat, 30 Apr 2011 16:52:40 -0300 Subject: Change stat_busy()/stat_done() -> status() Signed-off-by: Gerardo Exequiel Pozzi Signed-off-by: Tom Gundersen --- rc.shutdown | 17 +++++------------ rc.single | 5 +---- rc.sysinit | 3 +-- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index a78bc4d..604fdec 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -42,15 +42,12 @@ fi # Write to wtmp file before unmounting /sbin/halt -w -stat_busy "Deactivating Swap" -/sbin/swapoff -a -stat_done +status "Deactivating Swap" /sbin/swapoff -a # stop monitoring of lvm2 groups before unmounting filesystems if [[ $USELVM =~ yes|YES && -x /sbin/lvm && -d /sys/block ]]; then - stat_busy "Deactivating monitoring of LVM2 groups" - /sbin/vgchange --monitor n >/dev/null 2>&1 - stat_done + status "Deactivating monitoring of LVM2 groups" \ + /sbin/vgchange --monitor n >/dev/null 2>&1 fi stat_busy "Unmounting Filesystems" @@ -83,14 +80,10 @@ if [[ -f /etc/crypttab && -n $CS ]] && /bin/grep -q ^[^#] /etc/crypttab; then fi if [[ $USELVM =~ yes|YES && -x /sbin/lvm && -d /sys/block ]]; then - stat_busy "Deactivating LVM2 groups" - /sbin/vgchange --sysinit -a n >/dev/null 2>&1 - stat_done + status "Deactivating LVM2 groups" /sbin/vgchange --sysinit -a n >/dev/null 2>&1 fi -stat_busy "Remounting Root Filesystem Read-only" -/bin/mount -n -o remount,ro / -stat_done +status "Remounting Root Filesystem Read-only" /bin/mount -n -o remount,ro / run_hook shutdown_poweroff diff --git a/rc.single b/rc.single index 06bd83c..d1191d2 100755 --- a/rc.single +++ b/rc.single @@ -10,10 +10,7 @@ run_hook single_start if [[ $PREVLEVEL != N ]]; then kill_everything single - stat_busy "Starting UDev Daemon" - /sbin/udevd --daemon - stat_done - + status "Starting UDev Daemon" /sbin/udevd --daemon run_hook single_udevlaunched # Trigger udev uevents diff --git a/rc.sysinit b/rc.sysinit index dc4be58..e07afe6 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -275,8 +275,7 @@ if [[ -x /sbin/fsck ]]; then stat_done fi -stat_busy "Mounting Local Filesystems" -/bin/mount -n -o remount,rw / +status "Mounting Local Filesystems" /bin/mount -n -o remount,rw / # don't touch /etc/mtab if it is a symlink to /proc/self/mounts if [[ -L /etc/mtab ]]; then -- cgit v1.2.3 From bf329c43dc671746e23c1760f9a674c58898aebb Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 3 May 2011 21:09:07 +0200 Subject: workaround: symlink /var/run/daemons -> /run/daemons Some initscripts check the folder /var/run/daemons to see if another daemon is running. They should not do this as this folder is supposed to be internal to initscripts, and use ck_daemon instead. However, we add this workaround to minimize the pain. Should be removed one day. Signed-off-by: Tom Gundersen --- rc.sysinit | 1 + 1 file changed, 1 insertion(+) diff --git a/rc.sysinit b/rc.sysinit index e07afe6..1f2623b 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -316,6 +316,7 @@ stat_busy "Removing Leftover Files" /bin/mountpoint -q /tmp || /bin/rm -rf /tmp/* /tmp/.* &>/dev/null [[ ! -L /var/lock ]] && /bin/rm -rf /var/lock/* [[ ! -L /var/run && -d /var/run ]] && /usr/bin/find /var/run/ \! -type d -delete +[[ ! -L /var/run && ! -L /var/run/daemons ]] && /bin/ln -sf /run/daemons /var/run/daemons : >| /var/run/utmp /bin/chmod 0664 /var/run/utmp /bin/chown root:utmp /var/run/utmp -- cgit v1.2.3 From b329364663801e609a56f2f6a19d53bf5c754873 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Fri, 6 May 2011 21:37:50 +0200 Subject: Revert "udev: do not automatically save persistent net/cd udev rules to /etc on boot" This fixes FS#24115. The persistent net/cd rules will go away soon, but no replacement is in place yet, so we reinstate the copying magic. This partially reverts commit e9b658239f45d858ff7b30b46441b8733d20f151. Signed-off-by: Tom Gundersen --- rc.sysinit | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rc.sysinit b/rc.sysinit index 1f2623b..d9d3d27 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -372,6 +372,16 @@ fi # Set console font if required set_consolefont +# Adding persistent network/cdrom generated rules +# When the rules are generated before /etc is mounted rw they are saved to /run, +# we therefore need to copy this from /run to /etc. This functionality is going away one day. +for f in cd net; do + [[ -f /dev/.udev/tmp-rules--70-persistent-$f.rules ]] || continue + stat_busy "Adding persistent $f udev rules" + /bin/cat "/run/udev/tmp-rules--70-persistent-$f.rules" >> "/etc/udev/rules.d/70-persistent-$f.rules" + stat_done +done + /bin/dmesg >| /var/log/dmesg.log run_hook sysinit_end -- cgit v1.2.3 From 8ffdc007c28346ba0a733dbcdba62f91d23ce353 Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Mon, 9 May 2011 04:10:32 -0300 Subject: Fix copy&paste /dev/.udev -> /run/udev Signed-off-by: Gerardo Exequiel Pozzi Signed-off-by: Tom Gundersen --- rc.sysinit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc.sysinit b/rc.sysinit index d9d3d27..1521299 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -376,7 +376,7 @@ set_consolefont # When the rules are generated before /etc is mounted rw they are saved to /run, # we therefore need to copy this from /run to /etc. This functionality is going away one day. for f in cd net; do - [[ -f /dev/.udev/tmp-rules--70-persistent-$f.rules ]] || continue + [[ -f /run/udev/tmp-rules--70-persistent-$f.rules ]] || continue stat_busy "Adding persistent $f udev rules" /bin/cat "/run/udev/tmp-rules--70-persistent-$f.rules" >> "/etc/udev/rules.d/70-persistent-$f.rules" stat_done -- cgit v1.2.3 From 2acd4aaf8b84316e30b63ba1f785e2e15ddee4a3 Mon Sep 17 00:00:00 2001 From: Sebastien Luttringer Date: Thu, 5 May 2011 01:17:24 +0200 Subject: Rename rc into rc.d To avoid conflict with plan9 rc shell we need to rename our rc. Original name come from debian invoke-rc.d, shortened into rc. Signed-off-by: Sebastien Luttringer Signed-off-by: Tom Gundersen --- Makefile | 2 +- rc | 60 ------------------------------------------------------------ rc.d | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 61 deletions(-) delete mode 100755 rc create mode 100755 rc.d diff --git a/Makefile b/Makefile index d3a1824..6923840 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ install: minilogd installdirs install -m755 -t $(DESTDIR)/etc rc.local rc.local.shutdown rc.multi rc.shutdown rc.single rc.sysinit install -m755 -t $(DESTDIR)/etc/cron.hourly adjtime install -m755 -t $(DESTDIR)/etc/rc.d functions hwclock network netfs - install -m755 -t $(DESTDIR)/sbin minilogd rc + install -m755 -t $(DESTDIR)/sbin minilogd rc.d clean: rm -f minilogd minilogd.o diff --git a/rc b/rc deleted file mode 100755 index 743d86b..0000000 --- a/rc +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -. /etc/rc.conf -. /etc/rc.d/functions - -usage() { - cat >&2 << EOF -usage: rc action daemon ... - -e.g: rc list - rc help - rc start sshd gpm -EOF - exit 1 -} - -(( $# < 1 )) && usage - -declare -i ret=0 -case $1 in - help) - usage - ;; - list) - cd /etc/rc.d/ - for d in *; do - have_daemon "$d" || continue - # print running / stopped satus - if ! ck_daemon "$d"; then - printf "${C_OTHER}[${C_DONE}STARTED${C_OTHER}]" - else - printf "${C_OTHER}[${C_FAIL}STOPPED${C_OTHER}]" - fi - # print auto / manual status - if ! ck_autostart "$d"; then - printf "${C_OTHER}[${C_DONE}AUTO${C_OTHER}]" - else - printf "${C_OTHER}[${C_FAIL} ${C_OTHER}]" - fi - printf " ${C_MAIN}$d${C_CLEAR}\n" - done - ;; - *) - action=$1 - shift - # set same environment variables as init - runlevel=$(/sbin/runlevel) - ENV="PATH='/bin:/usr/bin:/sbin:/usr/sbin'" - ENV+=" PREVLEVEL='${runlevel:0:1}'" - ENV+=" RUNLEVEL='${runlevel:2:1}'" - ENV+=" CONSOLE='${CONSOLE:-/dev/console}'" - for i; do - [[ -x "/etc/rc.d/$i" ]] && cd / && eval /usr/bin/env -i $ENV "/etc/rc.d/$i" "$action" - (( ret += !! $? )) # clamp exit value to 0/1 - done -esac - -exit $ret - -# vim: set ts=2 sw=2 noet: diff --git a/rc.d b/rc.d new file mode 100755 index 0000000..743d86b --- /dev/null +++ b/rc.d @@ -0,0 +1,60 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +usage() { + cat >&2 << EOF +usage: rc action daemon ... + +e.g: rc list + rc help + rc start sshd gpm +EOF + exit 1 +} + +(( $# < 1 )) && usage + +declare -i ret=0 +case $1 in + help) + usage + ;; + list) + cd /etc/rc.d/ + for d in *; do + have_daemon "$d" || continue + # print running / stopped satus + if ! ck_daemon "$d"; then + printf "${C_OTHER}[${C_DONE}STARTED${C_OTHER}]" + else + printf "${C_OTHER}[${C_FAIL}STOPPED${C_OTHER}]" + fi + # print auto / manual status + if ! ck_autostart "$d"; then + printf "${C_OTHER}[${C_DONE}AUTO${C_OTHER}]" + else + printf "${C_OTHER}[${C_FAIL} ${C_OTHER}]" + fi + printf " ${C_MAIN}$d${C_CLEAR}\n" + done + ;; + *) + action=$1 + shift + # set same environment variables as init + runlevel=$(/sbin/runlevel) + ENV="PATH='/bin:/usr/bin:/sbin:/usr/sbin'" + ENV+=" PREVLEVEL='${runlevel:0:1}'" + ENV+=" RUNLEVEL='${runlevel:2:1}'" + ENV+=" CONSOLE='${CONSOLE:-/dev/console}'" + for i; do + [[ -x "/etc/rc.d/$i" ]] && cd / && eval /usr/bin/env -i $ENV "/etc/rc.d/$i" "$action" + (( ret += !! $? )) # clamp exit value to 0/1 + done +esac + +exit $ret + +# vim: set ts=2 sw=2 noet: -- cgit v1.2.3 From 1640b0515f56dfa18c0237a686ade7f3b6893c81 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 12 May 2011 02:44:48 +0200 Subject: fixup: symlink /var/run/daemons -> /run/daemons This did not work if the folder existed already. Rather than overwriting the folder with a symlink, the symlink was placed in the folder. Signed-off-by: Tom Gundersen --- rc.sysinit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc.sysinit b/rc.sysinit index 1521299..d0003ab 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -316,7 +316,8 @@ stat_busy "Removing Leftover Files" /bin/mountpoint -q /tmp || /bin/rm -rf /tmp/* /tmp/.* &>/dev/null [[ ! -L /var/lock ]] && /bin/rm -rf /var/lock/* [[ ! -L /var/run && -d /var/run ]] && /usr/bin/find /var/run/ \! -type d -delete -[[ ! -L /var/run && ! -L /var/run/daemons ]] && /bin/ln -sf /run/daemons /var/run/daemons +[[ ! -L /var/run && ! -L /var/run/daemons ]] && /bin/rm -rf /var/run/daemons \ + && /bin/ln -s /run/daemons /var/run/daemons : >| /var/run/utmp /bin/chmod 0664 /var/run/utmp /bin/chown root:utmp /var/run/utmp -- cgit v1.2.3 From bdf728fbfaf439c3b8d0fae5013330277648ec9b Mon Sep 17 00:00:00 2001 From: Sebastien Luttringer Date: Wed, 4 May 2011 23:40:33 +0200 Subject: Improve rc printing - print daemon text with C_CLEAR and not C_MAIN - print rc name based on $0 (in case of renaming) Signed-off-by: Sebastien Luttringer Signed-off-by: Tom Gundersen --- rc.d | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rc.d b/rc.d index 743d86b..02c2b6c 100755 --- a/rc.d +++ b/rc.d @@ -4,12 +4,13 @@ . /etc/rc.d/functions usage() { - cat >&2 << EOF -usage: rc action daemon ... + local name=${0##*/} + cat >&2 << EOF +usage: $name action daemon ... -e.g: rc list - rc help - rc start sshd gpm +e.g: $name list + $name help + $name start sshd gpm EOF exit 1 } @@ -37,7 +38,7 @@ case $1 in else printf "${C_OTHER}[${C_FAIL} ${C_OTHER}]" fi - printf " ${C_MAIN}$d${C_CLEAR}\n" + printf " ${C_CLEAR}$d\n" done ;; *) -- cgit v1.2.3 From c6b3853de29e5bb42adda4a2f62a08d87ea15740 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 12 May 2011 13:08:56 +0200 Subject: releasing: update instructinos after going through it once I struggled a bit with finding the simplest way of creating packages, so after asking on irc, I thought I'd add the answer here. This is not really initscripts specific, so could easiy be expanded and put in a wiki. Should work for any package that can be built without also building its deps. Signed-off-by: Tom Gundersen --- RELEASE | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/RELEASE b/RELEASE index 786b286..63c228a 100644 --- a/RELEASE +++ b/RELEASE @@ -15,4 +15,29 @@ Releasing 4) check that the PKGBUILD in git is in sync with the PKGBUILD to be released -5) create packages for both arches and push to testing +5) create package and push to testing: + + 5.1) [first time only] set up ssh forwarding so you can connect to gerolde from alderaan + + 5.1.1) Add "ForwardAgent=yes" to ~/.ssh/config + + 5.1.2) Add your private key to the authentication agent "ssh-add" + + 5.2) ssh pkgbuild.com + + 5.3) [first time only] check out initscripts from svn + + 5.3.1) svn checkout -N svn+ssh://gerolde.archlinux.org/srv/svn-packages + + 5.3.2) "cd svn-packages && svn update initscripts" + + 5.4) get the latest version of initscripts: "cd svn-packages && svn update" + + 5.5) update the version field in the PKGBUILD + + 5.6) build the package for both arches: "sudo testing-{i686,x86_64}-build" + + 5.7) run checkpkg, namcap, and install test at least one of the two packages + + 5.8) commit to svn and move package to your staging folder (which needs to exist on gerolde): + 'testingpkg "commit message"' -- cgit v1.2.3