Age | Commit message (Collapse) | Author | Files |
|
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>
|
|
|
|
|
|
|
|
kill_everything
|
|
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.
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
In particular, recomend against using ck_depends.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
Implemented suggestions of Dave.
get_pid:
Arguments: programname
Returns: PID of program
ck_pidfile:
Arguments: PID-file programname
Returns: 0 - PID in PID-file is of program
1 - PID in PID-file is not of program
Signed-off-by: Andrwe Lord Weber <archlinux@andrwe.org>
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
|
|
|