Age | Commit message (Collapse) | Author | Files |
|
We were in certain situations still writing to locale.sh. While it would
not have caused any harm, it was unintended and now removed.
This change means that locale.sh will no longer load the consolemap. This
would only be useful if it had been reset accidentally, and logging in again
would then fix a broken console. The issue is described in FS#18759. It is
not clear to me if this is still an issue, or if it solved by our new
utf8/non-utf8 handling.
Either way, resetting the consolemap unconditionaly does not make much sense
in case the user has changed it on purpose.
It might make sense to factor out the vconsole initialization into a
"setup/repair my console" script, similar to systemd's
/lib/systemd/systemd-vconsole-setup, but that would have to wait for a
future release.
Reported-by: Dave Reisner <d@falconindy.com>
Cc: Роман Кирилич <roman.kyrylych@gmail.com>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
...where it belongs
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Embarassing. This function was just plain broken.
- read/trim the correct variables
- allow comments (only start of line, no midline)
- allow quoting via single or double quotes.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
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>
|
|
This also fixes a bug that unintentionally sets LOCALE instead of
just defaulting to a value when its empty.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
In particular "^[[119G".
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
Factor out umounting. Explicitly skip umounting API directories, rather
than matching on fs type. This allows us to e.g. unmount all tmpfs but leaving
/run and /dev/shm alone.
v3: fixed some regressions in v2, made 'API filesystems' less general
v2: new umount_all implementation based on proposal by Dave and input from
Anthony. Also, ignore ramfs as it is not backed by swap.
Cc: Dave Reisner <d@falconindy.com>
Cc: C Anthony Risinger <anthony@xtfx.me>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
|
|
We don't have the problem with non-bash shells here, but better make the support uniform.
|
|
This is mainly to support non-bash shells that cannot source rc.conf.
The format of /etc/locale.conf is described here:
<http://0pointer.de/public/systemd-man/locale.conf.html>.
If LANG is not set in locale.conf, then we fall back to LOCALE
from rc.conf, as before.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This can be a symlink or a regular file, and rc.sysinit will preserve it
as such.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
I was getting "^[71G", this fixed it.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
With the new logic we will only wait for the timeout in case of problems,
we therefore increase the timeout as this will make problems more obvious.
There has been reports of problems with processes not being terminated, but
hopefully this should help us reproduce them.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
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>
|
|
This isn't _all_ your modules. Just the extras specified from rc.conf.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Daemon running in background should let error output to be printed.
Standart output is still hided to have a correct printing in default cases.
This will help to detect error in daemon runned in background.
This will also remove have_daemon call which is already called in start_daemon.
Signed-off-by: Sebastien Luttringer <seblu@seblu.net>
|
|
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
Suggested-by: Karol B?a?ewicz <karol.blazewicz@gmail.com>
Suggested-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
Fixes #25623.
Reported-by: Segej Puykin <arch@sergej.pp.ru>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This keeps the functionality, but disables it by default.
Individual scripts/functions can turn it on if they want.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
Categorize actions as 'create' or 'remove', for finer control.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This is the same concept as systemd's tmpfiles handling, slightly
simplified to avoid timed re-triggering of file cleaning. Most of our
current file cleaning that takes place in rc.single and rc.sysinit is
replaced by this, with the exception that we hold onto the /var/lock and
/var/run for finer control, since we still check for the possibility of
these directories being symlinks and adjust accordingly.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
For checking whether a daemon is started via the DAEMONS array we use ck_autostart() now.
So make in_array() generic as the name suggests instead of removing '@'-prefixes from array members behind ones back.
Suggested-by: Dave Reisner <d@falconindy.com>
|
|
This is just a bit simpler.
in_array() should be fixed to be non daemon specific in a later patch.
|
|
Currently $NETFS is used only for fsck and mount in rc.sysinit.
Since we moved it into functions, we can use it in netfs too to get rid of redundancy.
functions:
* Move 'nosysfs' from $NETFS into the mount -a type list because thats obviously the only meaningfull place.
* Add 'nofuse.glusterfs' to $NETFS to match the lists in netfs.
* Remove all 'no'-prefixes from $NETFS to make it more useful and readable.
* Add 'no'-prefixes to fsck and mount -a commands by parameter substitution.
netfs:
* Instead of the literals use $NETFS from functions which contains the same types now
|
|
killall5 returns 2 if it didn't find any processes to send to. Using this avoids sleeping longer than needed. This saves another up to six seconds of reboot/shutdown/go-single time.
|
|
The exit code returned by the given command might be useful/expected, so don't discard but return it.
|
|
$FSCK_OUT/$FSCK_ERR might not be set when:
* unset in some custom sysinit_prefsck hook
* calling fsck() from a shutdown hook
|
|
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>
|
|
Now that we set PATH in functions, we can use is everywhere.
|
|
Prevent any word splitting where not intended.
|
|
Braces are not needed in this case as a variable name can not begin with a number.
|
|
|
|
Also sanitze the PATH for rc.single, rc.multi, rc.local and daemons.
|
|
|
|
|
|
|
|
|
|
All credits go to: Dave Reisner <d@falconindy.com>
|
|
|
|
|
|
|