aboutsummaryrefslogtreecommitdiff
path: root/rc.sysinit
AgeCommit message (Collapse)AuthorFiles
2011-11-06functions: implement a environment file parserDave Reisner1
This adds a 'parse_envfile' function that reads files such as /etc/locale.conf and /etc/vconsole.conf without sourcing them as bash logic. Several benefits are realized from this: - Impossible to execute arbitrary code - Bad syntax won't prevent the entire file from being read - Possible to limit what variables are allowed Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-11-06avoid unnecessary escaping of newlinesDave Reisner1
The bash parser assumes that an expression continues when || is at the end of a line. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-29minilogd: killTom Gundersen1
This is not very useful, is not maintained, has open serious bugs. Better to admit that it does not work and just remove it. Someone could easily make an AUR package with a hook, if they want it and can make it work as expected. The only case where this would be useful is in case lvm monitoring is in use and dmeventd sends out a message to syslog before syslog-ng is started (there is a very small window). However, not even this works atm (as far as I know) due to bugs in minilogd. Signed-off-by: Tom Gundersen <teg@jklm.no> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-29config: add /etc/vconsole.conf supportTom Gundersen1
Read KEYMAP, CONSOLEFONT and CONSOLEMAP from vconsole.conf. If they are set they take precedence over the values in rc.conf. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-10-18mtab: delete any stale locks2011.10.2Tom Gundersen1
This should fix (to the extent possible) #FS26337. Figured-out-by: Dave Reisner <d@falconindy.com> Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-09-25[initscripts] Remove too early /dev/null redirectionGerardo Exequiel Pozzi1
Since recent change in udev package [#1] (install: remove post-install) In case of booting without initramfs and there is no /dev/null: * if / is ro, devtmpfs mount will fail, in consecuence /dev will be mounted as tmpfs. * if / is rw, devtmpfs mount will success, but a regular file /dev/null in / will be created. [#1] http://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/udev&id=8728747c2b3d5d0506f7e6f1ac74edc0319591d6 Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-09-25timezone: create /etc/localtime as a symlinkDave Reisner1
Abstract out timezone setting into its own function, passing Country/Area as a parameter. Do some menial checking to make sure: - the zonefile actually exists, erroring when it doesn't - /etc/localtime is a symlink to the correct zoneinfo file, relinking when it isn't. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-08-05locale: make /etc/profile.d/locale.sh dynamicTom Gundersen1
locale.sh parses rc.conf at runtime and sets the LOCALE accordingly, rather than writing a static file at every boot. This eliminates yet another write to /etc. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-08-04/usr: clarify warning a bitTom Gundersen1
We still support a separate /usr if it was somehow mounted by the initrd. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-08-02/usr: warn on separate usrTom Gundersen1
We check for /usr/lib being present. If it is not, we assume /usr is not yet mounted and warn. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-07-17rc.sysinit: Move 'run_hook sysinit_start' after mount root read-onlyKurt J. Bosch1
Rationale Currently we have to duplicate at least the mount /proc code line into a custom sysinit_start hook to be able to start a splash daemon or something in case no initcpio is used. Moreover we want to make sure nothing can open files read/write on root which would block the read-only remount. So running the sysinit_start hook a bit later appears to be more save.
2011-07-17Fix/unify quotingKurt J. Bosch1
The rules should be: * Use quotes when literal strings are involved. * Use quotes when ever using a substitution which might produce blanks as a possitional parameter unless word splitting is intended. * Use quotes on the right hand side within '[[ = ]]' unless pattern matching is intended. * Don't use quotes for substitutions where not needed as in assignments.
2011-07-12functions/rc.sysinit: Refactor 'Removing Leftover Files' codeKurt J. Bosch1
Move it into a function to allow clean error detection of all steps performed and also to be able to reuse this in rc.single.
2011-07-12rc.sysinit: Fix /tmp/.* patternKurt J. Bosch1
Use correct patterns and get rid of the /dev/null redirection workaround needed when trying to remove '..'.
2011-07-12rc.sysinit: fixup fsck refactoringKurt J. Bosch1
Revert to using in_array() instead of is_in_array() which actually doesn't exist.
2011-07-10rc.sysinit: Simplify /var/run/daemons workaroundKurt J. Bosch1
There are only two possible situations: a) /var/run is a symlink to /run: Conditional result is always 'false' even without checking /var/run/daemons (which doesn't exist). b) /var/run is a directory: Conditional result is always 'true' because any symlink was removed when cleaning /var/run. So following changes can be made: * /var/run/daemons can be removed unconditionally because a symlink doesn't survive cleaning of /var/run anyway. * The check whether /var/run/daemons is a symlink can be dropped because it has actually no effect. Furthermore we can refactor to use the same conditional used for cleaning /var/run because we can't create the symlink if /var/run is not a directory.
2011-07-10rc.sysinit: Remove unneeded variables initializationsKurt J. Bosch1
Variables should be empty anyway here.
2011-07-10functions/rc.sysinit: Refactor fsck-redirection to prevent breakageKurt J. Bosch1
$FSCK_OUT/$FSCK_ERR might not be set when: * unset in some custom sysinit_prefsck hook * calling fsck() from a shutdown hook
2011-07-10rc.sysinit: Declare $FORCEFSCK read-onlyKurt J. Bosch1
This prevents sysinit_prefsck hooks from overwriting the value.
2011-07-10Refactor kill_everything, fsck_all and mount_all codeKurt J. Bosch1
Genaral scheme for hook positions is now: run_hook pre_foo if [[$WE_WANT_TO_DO_FOO]]]; then stat_busy "Doing foo" if [[$PRECONDITIONS_FOR_FOO_NOT_SATISFIED]]; then stat_fail else ... stat_done fi fi run hook post_foo rc.sysinit ----------- run_hook pre_foo [[$WE_WANT_TO_DO_FOO]] && status "Doing foo" foo run hook post_foo functions ------------ foo() { [[$PRECONDITIONS_FOR_FOO_NOT_SATISFIED]] && return 1 ... } Rationale Following this scheme as close as possible (without duplicating code and status messages) makes stuff more readable and uniform. Splitting kill_everything() into two new functions stop_all_daemons() and kill_all() also allows customization of either daemons stopping or process killing in an easy way. Suggested-by: Tom Gundersen <teg@jklm.no>
2011-07-10rc.sysinit: Fix stat_busy block indentationKurt J. Bosch1
The general rule is now: Align stat_{fail,done} with stat_busy
2011-06-28rc.sysinit: Add status output for mtab and dmesg.log creationKurt J. Bosch1
2011-06-28rc.sysinit: Refactor /etc/mtab symlink detection to avoid empty if clauseKurt J. Bosch1
2011-06-28Move export PATH into functionsKurt J. Bosch1
Also sanitze the PATH for rc.single, rc.multi, rc.local and daemons.
2011-06-28Move activate_vgs and crypt stat_busy to the top for consistencyKurt J. Bosch1
2011-06-28Move fsck executable check into fsck_all() for consistencyKurt J. Bosch1
2011-06-28rc.sysinit: Get rid of evalKurt J. Bosch1
2011-06-28Refactor to get rid of simple if-constuctsKurt J. Bosch1
2011-06-28Add some commentsKurt J. Bosch1
2011-06-28Fix local statements missing in ck_depends, ck_pidfile, do_unlock, ↵Kurt J. Bosch1
kill_everything
2011-06-28Fix '>|' not used allways when redirecting to filesKurt J. Bosch1
This avoids errors if one should set the noclobber shell option somewhere (within a daemon script or some custom function). We already had this, but it seems gone lost mostly.
2011-06-28rc.sysinit: Fix setting localeKurt J. Bosch1
When using process substitution with status(), the resulting /dev/fd/* might get lost before it is actualy used. This happens in case a custom stat_busy() forks a subshell.
2011-06-28rc.sysinit: Fix writing to /dev/urandomKurt J. Bosch1
Note: The code status "$text" $command > $file writes nothing because there's a &>/dev/null within status().
2011-06-28Fix whitespaceKurt J. Bosch1
2011-06-25hwclock: show statusTom Gundersen1
Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-06-25hwclock: use correct timezoneTom Gundersen1
To avoid setting the kernel timezone with an out-of-date /etc/localtime, we pass TZ directly to hwclock. Also document how TIMEZONE and HARDWARECLOCK are optional in rc.conf Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-06-25trivial: silence errorsTom Gundersen1
This is a cleanup of a commit 171da3d. We get errors because /tmp/. and /tmp/.. cannot be deleted on boot. Send them to /dev/null. Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-06-24Simplify /etc/profile.d/locale.sh creationKurt J. Bosch1
2011-06-24Get rid of simple if-constucts by using '&&'Kurt J. Bosch1
2011-06-24rc.sysinit/rc.single: Merge UDev stuff into a functionKurt J. Bosch1
rc.single changes (when coming from multi-user): * avoid settling UDev quietly as in rc.sysinit * modules defined in rc.conf are loaded if missing * minilogd is started before udevd as in rc.sysinit rc.sysinit behaviour is unchanged
2011-06-24Some more cosmeticsKurt J. Bosch1
2011-06-24Some cosmeticsKurt J. Bosch1
2011-06-24Simplify API filesystems mountingKurt J. Bosch1
2011-06-24Simplify keyboard map loading by using loadkeys autodetectionKurt J. Bosch1
2011-06-24Simplify creating files by using /bin/installKurt J. Bosch1
2011-06-24Simplify timezone copyingKurt J. Bosch1
Error/stat_fail when $TIMEZONE is invalid instead of skipping silently.
2011-06-24Fix hwclock commentsKurt J. Bosch1
2011-06-22Move mount -a into functions to allow custom override (fsck on loop)Kurt J. Bosch1
2011-06-22Allow custom fsck on shutdown via hook (FS#18736)Kurt J. Bosch1
2011-06-22Move fsck stuff into functions to allow custom overrides (FS#18736)Kurt J. Bosch1