2 Commits

Author SHA1 Message Date
Jay Larson
7de71fa1cd The following changes were made:
* Add URL
  * Removed /etc/rcX.d directories (should be provided by sysvinit)
  * Added 'service' script
  * Properly set VERBOSE and FSCKFIX in init.d/checkfs
  * Used = in favor of == in checkfs, halt and sendsignals
  * Removed ZFS from mountfs
2018-04-10 11:25:20 -05:00
Jay Larson
97906ebe04 init-functions now checks for read access before attempting to read environ 2017-12-10 11:47:48 -06:00
7 changed files with 20 additions and 28 deletions

View File

@@ -10,7 +10,7 @@
DEPENDS = dash,kmod,procps-ng,sysvinit
ARCH = x86_64
URL =
URL = http://snaplinux.org
REPO = core
BRIEF = Base scripts for sysvinit
DESC = This package supplies the core required init scripts for startup
@@ -18,7 +18,7 @@ DESC = This package supplies the core required init scripts for startup
ARCHIVE := ''
SRCDIR := $(PWD)/SRC/initscripts
PATCHDIR := $(PWD)/SRC/patches
VERSION := 1.5-0
VERSION := 1.8-0
include /usr/share/snap/Makefile.snaplinux

View File

@@ -1,6 +1,6 @@
dirs:
install -d -m 755 $(DESTDIR)/etc/default
install -d -m 755 $(DESTDIR)/etc/{rc{{0..6},S},init}.d
install -d -m 755 $(DESTDIR)/etc/init.d
install -d -m 755 $(DESTDIR)/lib/lsb
install -d -m 755 $(DESTDIR)/usr/share/initscripts
install -d -m 755 $(DESTDIR)/usr/share/man/man8
@@ -30,5 +30,6 @@ files:
install -m 644 rcS.default \
$(DESTDIR)/usr/share/initscripts/rcS.default
install -m 755 update-rc $(DESTDIR)/usr/sbin
install -m 755 service $(DESTDIR)/usr/sbin
install: dirs files

View File

@@ -8,7 +8,10 @@
# be enough
#
if [ -r /proc/1/environ ]; then
chkcontainer=$(sed 's/\x0/\n/g' < /proc/1/environ|grep -ia '^container\|^LXC')
fi
[ -n "$chkcontainer" ] && export $chkcontainer
COL52="\\033[52G"

View File

@@ -13,6 +13,8 @@
. /lib/lsb/init-functions
[ -z $container ] || exit 0
[ -z "$VERBOSE" ] && VERBOSE=no
[ -z "$FSCKFIX" ] && FSCKFIX=no
case "$1" in
start)
@@ -71,7 +73,7 @@ case "$1" in
case "$VERBOSE" in
1|y|yes)
echo
if [ $status == 0 ]; then
if [ "$status" = 0 ]; then
exit 0
else
log_init_msg "Filesystem issues detected"
@@ -79,15 +81,15 @@ case "$1" in
;;
esac
if [ $status == 0 ]; then
if [ "$status" = 0 ]; then
log_success_msg
elif [ $status != 1 ]; then
elif [ "$status" = 1 ]; then
log_warning_msg
echo
echo "WARNING: File system errors were detected and repaired."
echo
elif [ $status == 2 -o $status == 3 ]; then
elif [ "$status" = 2 -o "$status" = 3 ]; then
log_warning_msg
echo
@@ -97,7 +99,7 @@ case "$1" in
echo "Press enter to reboot"
read
reboot -f
elif [ $status -gt 3 -a $status -lt 16 ]; then
elif [ "$status" -gt 3 -a "$status" -lt 16 ]; then
log_failure_msg
echo

View File

@@ -19,11 +19,11 @@ case "$1" in
poweroff='-p'
netdown='-i'
if [ "$HALT" == "halt" ]; then
if [ "$HALT" = "halt" ]; then
poweroff=''
fi
if [ "$NETDOWN" == "no" ]; then
if [ "$NETDOWN" = "no" ]; then
netdown=''
fi

View File

@@ -9,8 +9,8 @@
# Default-Stop: 0 6
# Short-Description: Mounts/unmounts local filesystems
# Description: Remounts root filesystem read/write and mounts all
# remaining local filesystems defined in /etc/fstab or
# in ZFS. Remounts root filesystem read-only and unmounts
# remaining local filesystems defined in /etc/fstab.
# Remounts root filesystem read-only and unmounts
# remaining filesystems on stop.
# X-Required: true
### END INIT INFO
@@ -34,13 +34,6 @@ case "$1" in
rm /forcefsck && log_success_msg || log_failure_msg
fi
if [ -x /sbin/zpool ]; then
if zpool list rpool 2>&1 > /dev/null; then
log_init_msg "Mounting ZFS file systems"
zfs mount -a && log_success_msg || log_failure_msg
fi
fi
log_init_msg "Mounting remaining file systems"
mount -a -O no_netdev >/dev/null && log_success_msg || log_failure_msg
;;
@@ -49,13 +42,6 @@ case "$1" in
umount -a -d -r -t notmpfs,nosysfs,nodevtmpfs,noproc,nodevpts \
>/dev/null && log_success_msg || log_failure_msg
if [ -x /sbin/zpool ]; then
if zpool list rpool 2>&1 > /dev/null; then
log_init_msg "Unmounting ZFS file systems"
zfs umount -a && log_success_msg || log_failure_msg
fi
fi
mount -o remount,ro /
;;
*)

View File

@@ -29,7 +29,7 @@ case "$1" in
log_init_msg "Sending all processes the KILL signal"
killall5 -9
if [ "$?" == 0 -o "$?" == 2 ]; then
if [ "$?" = 0 -o "$?" = 2 ]; then
success=1
fi
fi