Subject: initscripts: Should not fsck when laptop is running on battery
Date: Sun, 04 Sep 2005 21:17:01 +0200
Package: initscripts
Version: 2.86.ds1-1
Tags: patch
While reviewing the patches from Ubuntu, I came across a nice
improvement. Make sure to not run fsck if the machine is running on
battery. This would make the boot process a lot better for laptops.
This is the patch needed to make this happen. It is not a proper
patch, because I fished it out of the larger patch from ubuntu, but it
should be no problem to apply this manually to the check-scripts.
debian/initscripts/etc/init.d/checkfs.sh
FSCKFIX=no
[ -f /etc/default/rcS ] && . /etc/default/rcS
+# See if we're on AC Power
+# If not, we're not gonna run our check (Ubuntu #4680)
+if [ -x /usr/bin/on_ac_power ]; then
+ /usr/bin/on_ac_power >/dev/null 2>&1
+ if [ $? -eq 1 ]; then
+ echo "On battery, not fscking!"
+ ac=no
+ fi
+fi
+
#
# Check the rest of the file systems.
#
-if [ ! -f /fastboot ]
+if [ ! -f /fastboot ] && [ -z "$ac" ]
then
if [ -f /forcefsck ]
then
debian/initscripts/etc/init.d/checkroot.sh
/sbin/sulogin $CONSOLE
reboot -f
fi
+# See if we're on AC Power
+# If not, we're not gonna run our check (Ubuntu #4680)
+if [ -x /usr/bin/on_ac_power ] && [ $rootcheck = yes ]; then
+ /usr/bin/on_ac_power >/dev/null 2>&1
+ if [ "$?" -eq 1 ]; then
+ echo "On battery, not fscking!"
+ rootcheck=no
+ fi
+fi
+
#
#See if we want to check the root file system.
#
FSCKCODE=0
if [ -f /fastboot ] || [ $rootcheck = no ]
Hello
I'm preparing an NMU of sysvinit, to fix a few bugs. Your bug report
is one of these bugs. To reduce the possibility of messing up, I want
to ask if you can test the packages I have prepared and verify that it
work for you and solve your problem.
The test packages are available from
<URL:http://developer.skolelinux.no/~pere/debian/packages/>. To test,
download them like this, and install them.
for f in initscripts_2.86.ds1-1.1.pere.7_i386.deb \
sysv-rc_2.86.ds1-1.1.pere.7_all.deb \
sysvinit_2.86.ds1-1.1.pere.7_i386.deb ; do \
wget http://developer.skolelinux.no/~pere/debian/packages/$f ; \
done
This is the current changelog:
sysvinit (2.86.ds1-1.1.pere.7) UNRELEASED; urgency=low
* Non-maintainer upload.
* Moved all changes to upstream source to debian/patches/, and use
dpatch to apply them.
* Splitted umountfs in umountfs and umountroot. (Closes: #252059)
* Avoid umounting /dev/ in umountfs. (Closes: #287243)
* Made sure all init.d scripts handle start or stop
argument. (Closes: #326495)
* Added GFS file system to list of networked file systems.
(Closes: #295094)
* Added ocfs2 file system in to list of networked file systems. Patch
from Fabio M. Di Nitto and Ubuntu.
* Modified pidof to not print empty line if no pid was found.
(Closes: #225476)
* Merged rcS into rc. (Closes: #326460)
* Added trailing newline to the rebooting message, to make sure
kernel messages end up on lines of their own during
reboot. (Closes: #323749)
* Rewrote /etc/mtab handling in mountvirtfs to work with
SELinux. (Closes: #270919)
* Added init.d script dependency info in LSB format. (Closes: #325933)
* Do not fsck when running on battery. Patch from Thom May and
Ubuntu. (Closes: #326647)
* Updated initscripts to depend on lsb-base, and use the LSB
functions in all init.d scripts. Patch from Ubuntu. (Closes: #269774)
* Added some support for VERBOSE in checkfs.sh.
* Convert french version of update-rc.d(8) from UTF-8 to
ISO-8859-1. (Closes: #273496)
* Make sure urandom pool size is restored on boot. (Closes: #267935)
* Make sure binaries are stripped when installed, to avoid lintian
warning.
* Fix typo in debian/README (seperate->separate).
* Modify debian/rules to install Debian changelog for sysv-rc and
initscripts as changelog.Debian to keep lintian happy.
* Corrected section of mountpoint(1) manual page.
* Changed init.d/rc to short-circit stop scripts when switching
runlevels. Based on patches from Lukas Eppler and Steven
Barker. (Closes: #30659)
* Optimize boot speed by enabling the short-circit of start-scripts
when switcing from rcS.d to the real runlevel.
* Make it easier to override /etc/defaults/rcS parameters. (Closes: #286081)
* Updated Standards-Version to 3.6.2.1 (no changes needed).
-- Petter Reinholdtsen <[email protected]> Sun, 4 Sep 2005 15:00:14 +0200
As you can see, there are quite a few changes, so I want to make sure
I did not mess anything up. I've tested the boot on two of my
machines, but would like to hear more test reports.
Version: 2.86.ds1-2
This bug was fixed with the upload of sysvinit version 2.86.ds1-2.
Not sure why this bug wasn't closed, but as a workaround I close it
no. This was the changelog of the upload closing this bug.
sysvinit (2.86.ds1-2) unstable; urgency=low
.
* This package is now maintained on Alioth as the pkg-sysvinit project.
* Add myself as uploader.
* Add support for linprocfs on kFreeBSD. Patch from Robert
Millan. (Closes: #300963)
* Rewrote /etc/mtab handling in mountvirtfs to work with SELinux.
Based on patch from Luke Kenneth Casson Leighton.
(Closes: #270919)
* Add SELinux support to sysvinit on linux. Add build-depend on
libselinux1-dev and libsepol1-dev for all linux archs. Patch from
Manoj Srivastava, based on patch from Fedora. (Closes: #242900,
#249515,#315611)
* Drop redundant build-depend on essensial package bash.
* Add version 0.47 of startpar(8) program from SuSe. Part of
experimental parallel booting system. Not included by default
yet, as it tend to hang during boot.
* Add support for starting init.d scripts on the same level in
parallel, to speed up the boot process a bit. Currently, only a
simple system is implemented (and enabled by adding
CONCURRENCY=shell in /etc/default/rcS). This simple system messes
up the script output during boot. Disabled by default. (Closes:
#316290)
* Add 'kdm xdm gdm $syslog' as conditional dependencies of
rmnologin, to move it further back in the boot process.
* Make sure bootlogd return non-error exit code after forking off
the child. (Closes: #326640)
* Add more warning flags to list of compiler flags, to get more
info about problematic code.
* Avoid race-condition while fork()ing. Patch from SuSe.
(Closes: #327612)
* Improve error message when fork() fail in init. Patch from SuSe.
* Avoid hardcoding tty name length in wall, use UT_LINESIZE instead.
Patch from SuSe.
* Force kernel to reschedule after killing processes. Patch from SuSe.
* Make sure killall never tries to kill init (pid 1). Patch from SuSe.
* Acknowledge NMUs. (Closes: #30659, #85221, #204857, #225476,
#247102, #248739 #252059, #267935, #269774, #269894, #272588,
#272916, #273496, #277204, #281782, #284426, #286081, #287243,
#288098, #289562, #295094, #295335, #296489, #300645, #311741,
#314351, #316431, #317385, #317704, #318453, #318857, #323749,
#325933, #326460, #326495, #326647)
Acknowledgement sent
to thanh dong <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian sysvinit maintainers <[email protected]>.
(Mon, 04 Dec 2017 17:27:03 GMT) (full text, mbox, link).
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.