[arch-projects] [initscripts][PATCH 1/4] tmpfiles, sysctl, binfmt: use the systemd tools
No point in reinventing the wheel. These and other tools are shipped in the systemd-tools package. Functionality should be unchanged, but we no longer have to maintain the code. Signed-off-by: Tom Gundersen <teg@jklm.no> --- Makefile | 8 -- arch-binfmt | 45 --------- arch-sysctl | 29 ------ arch-tmpfiles | 297 --------------------------------------------------------- functions | 2 +- rc.multi | 4 +- 6 files changed, 3 insertions(+), 382 deletions(-) delete mode 100755 arch-binfmt delete mode 100755 arch-sysctl delete mode 100755 arch-tmpfiles diff --git a/Makefile b/Makefile index a2e5e04..bea5570 100644 --- a/Makefile +++ b/Makefile @@ -7,13 +7,6 @@ DIRS := \ /etc/logrotate.d \ /etc/profile.d \ /usr/sbin \ - /etc/tmpfiles.d \ - /usr/lib/tmpfiles.d \ - /etc/binfmt.d \ - /usr/lib/binfmt.d \ - /etc/sysctl.d \ - /usr/lib/sysctl.d \ - /usr/lib/initscripts \ /usr/share/bash-completion/completions \ /usr/share/zsh/site-functions \ /usr/share/man/man5 \ @@ -41,7 +34,6 @@ install: installdirs doc install -m755 -t $(DESTDIR)/usr/sbin rc.d install -m644 -t $(DESTDIR)/usr/share/man/man5 $(filter %.5, $(MAN_PAGES)) install -m644 -t $(DESTDIR)/usr/share/man/man8 $(filter %.8, $(MAN_PAGES)) - install -m755 -t $(DESTDIR)/usr/lib/initscripts arch-tmpfiles arch-sysctl arch-binfmt install -m644 tmpfiles.conf $(DESTDIR)/usr/lib/tmpfiles.d/arch.conf install -m644 -T bash-completion $(DESTDIR)/usr/share/bash-completion/completions/rc.d install -m644 -T zsh-completion $(DESTDIR)/usr/share/zsh/site-functions/_rc.d diff --git a/arch-binfmt b/arch-binfmt deleted file mode 100755 index 91468ef..0000000 --- a/arch-binfmt +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# /usr/lib/initscripts/arch-binfmt -# -# Configure additional binary formats at boot -# - -shopt -s nullglob - -declare -a binfmt_d -# files given has argv supersede config files -if (( $# > 0 )); then - for arg; do [[ -r "$arg" ]] && binfmt_d+=("$arg"); done -else - binfmt_d=( - /usr/lib/binfmt.d/*.conf - /etc/binfmt.d/*.conf - /run/binfmt.d/*.conf - ) -fi - -# check there is file to load -(( ${#binfmt_d[@]} > 0 )) || exit 1 - -# mount binfmt_misc if api filesystem is missing -mountpoint -q /proc/sys/fs/binfmt_misc || - mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc - -# files declared later in the binfmt_d array will override earlier -# Example: `/etc/binfmt.d/foo.conf' supersedes `/usr/lib/binfmt.d/foo.conf'. -declare -A fragments -for path in "${binfmt_d[@]}"; do - [[ -f $path ]] && fragments[${path##*/}]=$path -done - -for path in "${fragments[@]}"; do - while read -r line; do - [[ ${line:0:1} == '#' ]] && continue - printf "%s" "$line" > /proc/sys/fs/binfmt_misc/register - done < "$path" -done - -: - -# vim: set ts=2 sw=2 noet: diff --git a/arch-sysctl b/arch-sysctl deleted file mode 100755 index f73f1f0..0000000 --- a/arch-sysctl +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# /usr/lib/initscripts/arch-sysctl -# -# Load sysctl configuration files following -# http://0pointer.de/public/systemd-man/sysctl.d.html -# - -shopt -s nullglob - -declare -a sysctl_d=( - /usr/lib/sysctl.d/*.conf - /etc/sysctl.d/*.conf - /run/sysctl.d/*.conf - /etc/sysctl.conf -) -declare -A fragments - -# files declared later in the sysctl_d array will override earlier -# Example: `/etc/sysctl.d/foo.conf' supersedes `/usr/lib/sysctl.d/foo.conf'. -for path in "${@:-${sysctl_d[@]}}"; do - [[ -f $path ]] && fragments[${path##*/}]=$path -done - -for path in "${fragments[@]}"; do - sysctl -q -p"$path" -done - -# vim: set ts=2 sw=2 noet: diff --git a/arch-tmpfiles b/arch-tmpfiles deleted file mode 100755 index 9355fdc..0000000 --- a/arch-tmpfiles +++ /dev/null @@ -1,297 +0,0 @@ -#!/bin/bash -# -# /usr/lib/initscripts/arch-tmpfiles -# -# Control creation, deletion, and cleaning of volatile and temporary files -# - -warninvalid() { - printf "arch-tmpfiles: ignoring invalid entry on line %d of \`%s'\n" "$LINENUM" "$FILE" - (( ++error )) -} >&2 - -checkparams() { - local parmreq=$1; shift - local path=$1 mode=$2 uid=$3 gid=$4 - - # parmcount must be >= parmreq - if (( $# < parmreq )); then - return 1 - fi - - # mode must be valid octal and 3 or 4 digits - if [[ $mode && ! $mode =~ ^[0-7]{3,4}$ ]]; then - return 1 - fi - - # uid must be numeric or a valid user name - # don't try to resolve numeric IDs in case they don't exist - if [[ $uid ]]; then - if [[ $uid != +([0-9]) ]] && ! getent passwd "$uid" >/dev/null; then - return 1 - fi - fi - - # gid must be numeric or a valid group name - # don't try to resolve numeric IDs in case they don't exist - if [[ $gid ]]; then - if [[ $gid != +([0-9]) ]] && ! getent group "$gid" >/dev/null; then - return 1 - fi - fi - - return 0 -} - -relabel() { - local -a paths=($1) - local mode=$2 uid=$3 gid=$4 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - for path in "${paths[@]}"; do - if [[ -e $path ]]; then - [[ $uid != '-' ]] && chown $CHOPTS "$uid" "$path" - [[ $gid != '-' ]] && chgrp $CHOPTS "$gid" "$path" - [[ $mode != '-' ]] && chmod $CHOPTS "$mode" "$path" - fi - done -} - -_f() { - # Create a file if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 - - (( CREATE )) || return 0 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - if [[ ! -e $path ]]; then - install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" - fi -} - -_F() { - # Create or truncate a file - local path=$1 mode=$2 uid=$3 gid=$4 - - (( CREATE )) || return 0 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" -} - -_d() { - # Create a directory if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 - - (( CREATE )) || return 0 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - if [[ ! -d "$path" ]]; then - install -d -m"$mode" -o"$uid" -g"$gid" "$path" - fi -} - -_D() { - # Create or empty a directory - local path=$1 mode=$2 uid=$3 gid=$4 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - if [[ -d $path ]] && (( REMOVE )); then - find "$path" -mindepth 1 -maxdepth 1 -xdev -exec rm -rf {} + - fi - - if (( CREATE )); then - install -d -m"$mode" -o"$uid" -g"$gid" "$path" - fi -} - -_p() { - # Create a named pipe (FIFO) if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 - - (( CREATE )) || return 0 - - if ! checkparams 4 "$@"; then - warninvalid - return - fi - - if [[ ! -p "$path" ]]; then - mkfifo -m$mode "$path" - chown "$uid:$gid" "$path" - fi -} - -_x() { - # Ignore a path during cleaning. Use this type to exclude paths from clean-up as - # controlled with the Age parameter. Note that lines of this type do not - # influence the effect of r or R lines. Lines of this type accept shell-style - # globs in place of of normal path names. - : - # XXX: we don't implement this -} - -_r() { - # Remove a file or directory if it exists. This may not be used to remove - # non-empty directories, use R for that. Lines of this type accept shell-style - # globs in place of normal path names. - local path - local -a paths=($1) - - (( REMOVE )) || return 0 - - if ! checkparams 1 "$@"; then - warninvalid - return - fi - - for path in "${paths[@]}"; do - if [[ -f $path ]]; then - rm -f "$path" - elif [[ -d $path ]]; then - rmdir "$path" - fi - done -} - -_R() { - # Recursively remove a path and all its subdirectories (if it is a directory). - # Lines of this type accept shell-style globs in place of normal path names. - local path - local -a paths=($1) - - (( REMOVE )) || return 0 - - if ! checkparams 1 "$@"; then - warninvalid - return - fi - - for path in "${paths[@]}"; do - [[ -d $path ]] && rm -rf --one-file-system "$path" - done -} - -_z() { - # Set ownership, access mode and relabel security context of a file or - # directory if it exists. Lines of this type accept shell-style globs in - # place of normal path names. - local -a paths=($1) - local mode=$2 uid=$3 gid=$4 - - (( CREATE )) || return 0 - - relabel "$@" -} - -_Z() { - # Recursively set ownership, access mode and relabel security context of a - # path and all its subdirectories (if it is a directory). Lines of this type - # accept shell-style globs in place of normal path names. - - (( CREATE )) || return 0 - - CHOPTS=-R relabel "$@" -} - -shopt -s nullglob - -declare -i CREATE=0 REMOVE=0 CLEAN=0 error=0 LINENO=0 -declare FILE= -declare -A fragments -declare -a tmpfiles_d=( - /usr/lib/tmpfiles.d/*.conf - /etc/tmpfiles.d/*.conf - /run/tmpfiles.d/*.conf -) - -while (( $# )); do - case $1 in - --create) CREATE=1 ;; - --remove) REMOVE=1 ;; - esac - shift -done - -if (( !(CREATE + REMOVE) )); then - printf 'usage: %s [--create] [--remove]\n' "${0##*/}" - exit 1 -fi - -# directories declared later in the tmpfiles_d array will override earlier -# directories, on a per file basis. -# Example: `/etc/tmpfiles.d/foo.conf' supersedes `/usr/lib/tmpfiles.d/foo.conf'. -for path in "${@:-${tmpfiles_d[@]}}"; do - [[ -f $path ]] && fragments[${path##*/}]=${path%/*} -done - -# catch errors in functions so we can exit with something meaningful -set -E -trap '(( ++error ))' ERR - -# loop through the gathered fragments, sorted globally by filename. -# `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf' -while read -d '' fragment; do - LINENUM=0 - - printf -v FILE '%s/%s' "${fragments[$fragment]}" "$fragment" - - ### FILE FORMAT ### - # XXX: We ignore the final 'Age' parameter - # 0 1 2 3 4 5 - # Type Path Mode UID GID Age - # d /run/user 0755 root root 10d - - # omit read's -r flag to honor escapes here, so that whitespace can be - # escaped for paths. We will _not_ honor quoted paths. - while read -a line; do - (( ++LINENUM )) - - # skip over comments and empty lines - if (( ! ${#line[*]} )) || [[ ${line[0]:0:1} = '#' ]]; then - continue - fi - - # whine about invalid entries - if ! type -t _${line[0]} >/dev/null; then - warninvalid - continue - fi - - # fall back on defaults when parameters are passed as '-' - if [[ ${line[2]} = '-' ]]; then - case ${line[0]} in - p|f|F) line[2]=0644 ;; - d|D) line[2]=0755 ;; - esac - fi - [[ ${line[3]} = '-' ]] && line[3]='root' - [[ ${line[4]} = '-' ]] && line[4]='root' - - "_${line[@]}" - done <"$FILE" -done < <(printf '%s\0' "${!fragments[@]}" | sort -z) - -exit $error - -# vim: set ts=2 sw=2 noet: diff --git a/functions b/functions index 7516345..0d488a7 100644 --- a/functions +++ b/functions @@ -579,7 +579,7 @@ umount_all() { remove_leftover() { stat_busy "Removing Leftover Files" - /usr/lib/initscripts/arch-tmpfiles --create --remove && stat_done || stat_fail + /usr/lib/systemd/systemd-tmpfiles --create --remove && stat_done || stat_fail # move from static /var/{run,lock} to /run if [[ ! -L /var/lock ]]; then rm -rf /var/lock diff --git a/rc.multi b/rc.multi index 20ed9bc..d558753 100755 --- a/rc.multi +++ b/rc.multi @@ -9,10 +9,10 @@ run_hook multi_start # Load sysctl config files -[[ -x /usr/lib/initscripts/arch-sysctl ]] && /usr/lib/initscripts/arch-sysctl +/usr/lib/systemd/systemd-sysctl # Load additional binary formats -[[ -x /usr/lib/initscripts/arch-binfmt ]] && /usr/lib/initscripts/arch-binfmt +/usr/lib/systemd/systemd-binfmt # Start daemons for daemon in "${DAEMONS[@]}"; do -- 1.7.10.2
Signed-off-by: Tom Gundersen <teg@jklm.no> --- functions | 18 ------------------ rc.sysinit | 32 +------------------------------- 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/functions b/functions index 0d488a7..2f03d6a 100644 --- a/functions +++ b/functions @@ -658,24 +658,6 @@ if (( RC_FUNCTIONS_HOOK_FUNCS_DEFINED != 1 )); then declare -r RC_FUNCTIONS_HOOK_FUNCS_DEFINED=1 fi -# Function for setting console font if required -set_consolefont() { - [[ $CONSOLEFONT ]] || return 0 - stat_busy "Loading Console Font: $CONSOLEFONT" - #CONSOLEMAP in UTF-8 shouldn't be used - [[ $CONSOLEMAP && ${LOCALE,,} =~ utf ]] && CONSOLEMAP="" - local i - for i in /dev/tty[0-9]*; do - setfont ${CONSOLEMAP:+-m "${CONSOLEMAP}"} \ - "$CONSOLEFONT" -C ${i} &>/dev/null - done - if (( $? )); then - stat_fail - else - stat_done - fi -} - if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then export LANG=${LOCALE:-C} if [[ -r /etc/locale.conf ]]; then diff --git a/rc.sysinit b/rc.sysinit index 32313ab..f7743bc 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -75,38 +75,8 @@ if [[ -s /etc/locale.conf ]]; then parse_envfile /etc/locale.conf "LANG" [[ $LANG ]] && LOCALE=$LANG fi -if [[ ${LOCALE,,} =~ utf ]]; then - stat_busy "Setting Consoles to UTF-8 mode" - # UTF-8 consoles are default since 2.6.24 kernel - # this code is needed not only for older kernels, - # but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8. - for i in /dev/tty[0-9]*; do - kbd_mode -u < ${i} - printf "\e%%G" > ${i} - done - echo 1 >| /sys/module/vt/parameters/default_utf8 - stat_done -else - stat_busy "Setting Consoles to legacy mode" - # make non-UTF-8 consoles work on 2.6.24 and newer kernels - for i in /dev/tty[0-9]*; do - kbd_mode -a < ${i} - printf "\e%%@" > ${i} - done - echo 0 >| /sys/module/vt/parameters/default_utf8 - stat_done -fi - -if [[ -s /etc/vconsole.conf ]]; then - parse_envfile /etc/vconsole.conf "${vconsolevars[@]}" - [[ $FONT ]] && CONSOLEFONT=$FONT - [[ $FONT_MAP ]] && CONSOLEMAP=$FONT_MAP -fi -[[ $KEYMAP ]] && - status "Loading Keyboard Map: $KEYMAP" loadkeys -q $KEYMAP -# Set console font if required -set_consolefont +status "Configuring Virtual Console" /usr/lib/systemd/systemd-vconsole-setup # bring up the loopback interface [[ -d /sys/class/net/lo ]] && -- 1.7.10.2
On Mon, May 28, 2012 at 10:42:00PM +0200, Tom Gundersen wrote:
Signed-off-by: Tom Gundersen <teg@jklm.no> --- functions | 18 ------------------ rc.sysinit | 32 +------------------------------- 2 files changed, 1 insertion(+), 49 deletions(-)
diff --git a/functions b/functions index 0d488a7..2f03d6a 100644 --- a/functions +++ b/functions @@ -658,24 +658,6 @@ if (( RC_FUNCTIONS_HOOK_FUNCS_DEFINED != 1 )); then declare -r RC_FUNCTIONS_HOOK_FUNCS_DEFINED=1 fi
-# Function for setting console font if required -set_consolefont() { - [[ $CONSOLEFONT ]] || return 0 - stat_busy "Loading Console Font: $CONSOLEFONT" - #CONSOLEMAP in UTF-8 shouldn't be used - [[ $CONSOLEMAP && ${LOCALE,,} =~ utf ]] && CONSOLEMAP="" - local i - for i in /dev/tty[0-9]*; do - setfont ${CONSOLEMAP:+-m "${CONSOLEMAP}"} \ - "$CONSOLEFONT" -C ${i} &>/dev/null - done - if (( $? )); then - stat_fail - else - stat_done - fi -} - if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then export LANG=${LOCALE:-C} if [[ -r /etc/locale.conf ]]; then diff --git a/rc.sysinit b/rc.sysinit index 32313ab..f7743bc 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -75,38 +75,8 @@ if [[ -s /etc/locale.conf ]]; then parse_envfile /etc/locale.conf "LANG" [[ $LANG ]] && LOCALE=$LANG fi -if [[ ${LOCALE,,} =~ utf ]]; then - stat_busy "Setting Consoles to UTF-8 mode" - # UTF-8 consoles are default since 2.6.24 kernel - # this code is needed not only for older kernels, - # but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8. - for i in /dev/tty[0-9]*; do - kbd_mode -u < ${i} - printf "\e%%G" > ${i} - done - echo 1 >| /sys/module/vt/parameters/default_utf8 - stat_done -else - stat_busy "Setting Consoles to legacy mode" - # make non-UTF-8 consoles work on 2.6.24 and newer kernels - for i in /dev/tty[0-9]*; do - kbd_mode -a < ${i} - printf "\e%%@" > ${i} - done - echo 0 >| /sys/module/vt/parameters/default_utf8 - stat_done -fi - -if [[ -s /etc/vconsole.conf ]]; then - parse_envfile /etc/vconsole.conf "${vconsolevars[@]}" - [[ $FONT ]] && CONSOLEFONT=$FONT - [[ $FONT_MAP ]] && CONSOLEMAP=$FONT_MAP -fi -[[ $KEYMAP ]] && - status "Loading Keyboard Map: $KEYMAP" loadkeys -q $KEYMAP
-# Set console font if required -set_consolefont
Maybe a comment here that systemd-vconsole-setup knows how to read /etc/rc.conf.
+status "Configuring Virtual Console" /usr/lib/systemd/systemd-vconsole-setup
# bring up the loopback interface [[ -d /sys/class/net/lo ]] && -- 1.7.10.2
On May 29, 2012 12:11 AM, "Dave Reisner" <d@falconindy.com> wrote:
On Mon, May 28, 2012 at 10:42:00PM +0200, Tom Gundersen wrote:
Signed-off-by: Tom Gundersen <teg@jklm.no> --- functions | 18 ------------------ rc.sysinit | 32 +------------------------------- 2 files changed, 1 insertion(+), 49 deletions(-)
diff --git a/functions b/functions index 0d488a7..2f03d6a 100644 --- a/functions +++ b/functions @@ -658,24 +658,6 @@ if (( RC_FUNCTIONS_HOOK_FUNCS_DEFINED != 1 )); then declare -r RC_FUNCTIONS_HOOK_FUNCS_DEFINED=1 fi
-# Function for setting console font if required -set_consolefont() { - [[ $CONSOLEFONT ]] || return 0 - stat_busy "Loading Console Font: $CONSOLEFONT" - #CONSOLEMAP in UTF-8 shouldn't be used - [[ $CONSOLEMAP && ${LOCALE,,} =~ utf ]] && CONSOLEMAP="" - local i - for i in /dev/tty[0-9]*; do - setfont ${CONSOLEMAP:+-m "${CONSOLEMAP}"} \ - "$CONSOLEFONT" -C ${i} &>/dev/null - done - if (( $? )); then - stat_fail - else - stat_done - fi -} - if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then export LANG=${LOCALE:-C} if [[ -r /etc/locale.conf ]]; then diff --git a/rc.sysinit b/rc.sysinit index 32313ab..f7743bc 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -75,38 +75,8 @@ if [[ -s /etc/locale.conf ]]; then parse_envfile /etc/locale.conf "LANG" [[ $LANG ]] && LOCALE=$LANG fi -if [[ ${LOCALE,,} =~ utf ]]; then - stat_busy "Setting Consoles to UTF-8 mode" - # UTF-8 consoles are default since 2.6.24 kernel - # this code is needed not only for older kernels, - # but also when user has set vt.default_utf8=0 but LOCALE
is *.UTF-8.
- for i in /dev/tty[0-9]*; do - kbd_mode -u < ${i} - printf "\e%%G" > ${i} - done - echo 1 >| /sys/module/vt/parameters/default_utf8 - stat_done -else - stat_busy "Setting Consoles to legacy mode" - # make non-UTF-8 consoles work on 2.6.24 and newer kernels - for i in /dev/tty[0-9]*; do - kbd_mode -a < ${i} - printf "\e%%@" > ${i} - done - echo 0 >| /sys/module/vt/parameters/default_utf8 - stat_done -fi - -if [[ -s /etc/vconsole.conf ]]; then - parse_envfile /etc/vconsole.conf "${vconsolevars[@]}" - [[ $FONT ]] && CONSOLEFONT=$FONT - [[ $FONT_MAP ]] && CONSOLEMAP=$FONT_MAP -fi -[[ $KEYMAP ]] && - status "Loading Keyboard Map: $KEYMAP" loadkeys -q $KEYMAP
-# Set console font if required -set_consolefont
Maybe a comment here that systemd-vconsole-setup knows how to read /etc/rc.conf.
Yeah, there should be no functional change.
+status "Configuring Virtual Console" /usr/lib/systemd/systemd-vconsole-setup
# bring up the loopback interface [[ -d /sys/class/net/lo ]] && -- 1.7.10.2
On Mon, May 28, 2012 at 10:42 PM, Tom Gundersen <teg@jklm.no> wrote:
-# Set console font if required -set_consolefont +status "Configuring Virtual Console" /usr/lib/systemd/systemd-vconsole-setup Simple quoting is better. Maybe adding a "s" to "Console"?
-- Sébastien Luttringer www.seblu.net
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.shutdown | 13 +------------ rc.sysinit | 5 +---- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index ec30d56..fc520a6 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -19,18 +19,7 @@ run_hook shutdown_start stop_all_daemons -stat_busy "Saving Random Seed" - RANDOM_SEED=/var/lib/misc/random-seed - install -TDm 0600 /dev/null $RANDOM_SEED - POOL_FILE=/proc/sys/kernel/random/poolsize - if [[ -r $POOL_FILE ]]; then - read POOL_SIZE < $POOL_FILE - (( POOL_SIZE /= 8 )) - else - POOL_SIZE=512 - fi - dd if=/dev/urandom of=$RANDOM_SEED count=1 bs=$POOL_SIZE &>/dev/null -stat_done +status "Saving Random Seed" /usr/lib/systemd/systemd-random-seed save [[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE" diff --git a/rc.sysinit b/rc.sysinit index f7743bc..a1097df 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -135,10 +135,7 @@ status "Activating Swap" swapon -a [[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE" -RANDOM_SEED=/var/lib/misc/random-seed -[[ -f $RANDOM_SEED ]] && - status "Initializing Random Seed" \ - cp $RANDOM_SEED /dev/urandom +status "Initializing Random Seed" /usr/lib/systemd/systemd-random-seed load # Remove leftover files remove_leftover -- 1.7.10.2
On Mon, May 28, 2012 at 10:42 PM, Tom Gundersen <teg@jklm.no> wrote:
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.shutdown | 13 +------------ rc.sysinit | 5 +---- 2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/rc.shutdown b/rc.shutdown index ec30d56..fc520a6 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -19,18 +19,7 @@ run_hook shutdown_start
stop_all_daemons
-stat_busy "Saving Random Seed" - RANDOM_SEED=/var/lib/misc/random-seed - install -TDm 0600 /dev/null $RANDOM_SEED - POOL_FILE=/proc/sys/kernel/random/poolsize - if [[ -r $POOL_FILE ]]; then - read POOL_SIZE < $POOL_FILE - (( POOL_SIZE /= 8 )) - else - POOL_SIZE=512 - fi - dd if=/dev/urandom of=$RANDOM_SEED count=1 bs=$POOL_SIZE &>/dev/null -stat_done +status "Saving Random Seed" /usr/lib/systemd/systemd-random-seed save simple quote here
[[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE"
diff --git a/rc.sysinit b/rc.sysinit index f7743bc..a1097df 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -135,10 +135,7 @@ status "Activating Swap" swapon -a
[[ $TIMEZONE ]] && status "Configuring Time Zone" set_timezone "$TIMEZONE"
-RANDOM_SEED=/var/lib/misc/random-seed -[[ -f $RANDOM_SEED ]] && - status "Initializing Random Seed" \ - cp $RANDOM_SEED /dev/urandom +status "Initializing Random Seed" /usr/lib/systemd/systemd-random-seed load
idem, simple quote -- Sébastien Luttringer www.seblu.net
We only have one that is initsrcipts specific. Signed-off-by: Tom Gundersen <teg@jklm.no> --- tmpfiles.conf | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tmpfiles.conf b/tmpfiles.conf index a63ca07..8f99a99 100644 --- a/tmpfiles.conf +++ b/tmpfiles.conf @@ -2,20 +2,4 @@ # /usr/lib/tmpfiles.d/arch.conf # -D /tmp 1777 root root 10d d /run/daemons 0755 root root - - -d /tmp/.X11-unix 1777 root root 10d -d /tmp/.ICE-unix 1777 root root 10d -d /tmp/.XIM-unix 1777 root root 10d -d /tmp/.font-unix 1777 root root 10d -d /tmp/.Test-unix 1777 root root 10d - -F /run/utmp 0664 root utmp - - -r /tmp/.X[0-9]-lock -r /etc/nologin -r /etc/shutdownpid -r /forcefsck -r /fastboot - -- 1.7.10.2
On Mon, May 28, 2012 at 10:42 PM, Tom Gundersen <teg@jklm.no> wrote:
We only have one that is initsrcipts specific.
Signed-off-by: Tom Gundersen <teg@jklm.no> --- tmpfiles.conf | 16 ---------------- 1 file changed, 16 deletions(-)
diff --git a/tmpfiles.conf b/tmpfiles.conf index a63ca07..8f99a99 100644 --- a/tmpfiles.conf +++ b/tmpfiles.conf @@ -2,20 +2,4 @@ # /usr/lib/tmpfiles.d/arch.conf #
-D /tmp 1777 root root 10d d /run/daemons 0755 root root - - -d /tmp/.X11-unix 1777 root root 10d -d /tmp/.ICE-unix 1777 root root 10d -d /tmp/.XIM-unix 1777 root root 10d -d /tmp/.font-unix 1777 root root 10d -d /tmp/.Test-unix 1777 root root 10d - -F /run/utmp 0664 root utmp - - -r /tmp/.X[0-9]-lock -r /etc/nologin -r /etc/shutdownpid -r /forcefsck -r /fastboot - -- 1.7.10.2
filename should be initscripts.conf instead of arch.conf? -- Sébastien Luttringer www.seblu.net
On Tue, May 29, 2012 at 12:57 AM, Seblu <seblu@seblu.net> wrote:
filename should be initscripts.conf instead of arch.conf?
Indeed. Done in git. -t
On Mon, May 28, 2012 at 10:41 PM, Tom Gundersen <teg@jklm.no> wrote:
diff --git a/functions b/functions index 7516345..0d488a7 100644 --- a/functions +++ b/functions @@ -579,7 +579,7 @@ umount_all() {
remove_leftover() { stat_busy "Removing Leftover Files" - /usr/lib/initscripts/arch-tmpfiles --create --remove && stat_done || stat_fail + /usr/lib/systemd/systemd-tmpfiles --create --remove && stat_done || stat_fail status /usr/lib/systemd/systemd-tmpfiles --create --remove
-- Sébastien Luttringer www.seblu.net
On Tue, May 29, 2012 at 12:56:37AM +0200, Seblu wrote:
On Mon, May 28, 2012 at 10:41 PM, Tom Gundersen <teg@jklm.no> wrote:
diff --git a/functions b/functions index 7516345..0d488a7 100644 --- a/functions +++ b/functions @@ -579,7 +579,7 @@ umount_all() {
remove_leftover() { stat_busy "Removing Leftover Files" - /usr/lib/initscripts/arch-tmpfiles --create --remove && stat_done || stat_fail + /usr/lib/systemd/systemd-tmpfiles --create --remove && stat_done || stat_fail status /usr/lib/systemd/systemd-tmpfiles --create --remove
-- Sébastien Luttringer www.seblu.net
status -v ... hiding errors here isn't a good idea.
participants (3)
-
Dave Reisner
-
Seblu
-
Tom Gundersen