Compare commits
	
		
			5 Commits
		
	
	
		
			0.45.2
			...
			funtoo-ope
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					67b2255ebb | ||
| 
						 | 
					6eace7dc5a | ||
| 
						 | 
					11e1f4d30d | ||
| 
						 | 
					c30a8d2c3c | ||
| 
						 | 
					419af8f0aa | 
@@ -1,2 +1,2 @@
 | 
			
		||||
# Set to the hostname of this machine
 | 
			
		||||
# Set to the fully-qualified hostname of this machine
 | 
			
		||||
hostname="localhost"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								init.d/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								init.d/.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -3,7 +3,6 @@ fsck
 | 
			
		||||
hostname
 | 
			
		||||
local
 | 
			
		||||
localmount
 | 
			
		||||
loopback
 | 
			
		||||
moused
 | 
			
		||||
netmount
 | 
			
		||||
network
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
include ../mk/net.mk
 | 
			
		||||
 | 
			
		||||
DIR=	${INITDIR}
 | 
			
		||||
SRCS=	bootmisc.in fsck.in hostname.in local.in localmount.in loopback.in \
 | 
			
		||||
SRCS=	bootmisc.in fsck.in hostname.in local.in localmount.in \
 | 
			
		||||
	netmount.in root.in savecache.in swap.in swapfiles.in \
 | 
			
		||||
	tmpfiles.setup.in swclock.in sysctl.in urandom.in ${SRCS-${OS}}
 | 
			
		||||
BIN=	${OBJS}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,18 +1,42 @@
 | 
			
		||||
#!@SBINDIR@/runscript
 | 
			
		||||
#!@PREFIX@/sbin/runscript
 | 
			
		||||
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
 | 
			
		||||
# Released under the 2-clause BSD license.
 | 
			
		||||
 | 
			
		||||
description="Sets the hostname of the machine."
 | 
			
		||||
 | 
			
		||||
depend() {
 | 
			
		||||
	keyword -prefix -lxc
 | 
			
		||||
	need root
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
start()
 | 
			
		||||
{
 | 
			
		||||
	# HOSTNAME variable used to be defined in caps in conf.d/hostname.
 | 
			
		||||
	# It is also a magic variable in bash.
 | 
			
		||||
	hostname=${hostname-${HOSTNAME-localhost}} # checkbashisms: false positive
 | 
			
		||||
	hostname=${hostname-${HOSTNAME-localhost}}
 | 
			
		||||
	out=$hostname
 | 
			
		||||
	short=${hostname%%.*}
 | 
			
		||||
	if [ "$short" != "$hostname" ]; then
 | 
			
		||||
		out="$out $short"
 | 
			
		||||
	fi
 | 
			
		||||
	if [ "$nisdomainname" != "" ]; then
 | 
			
		||||
		ebegin "Setting NIS domain name to $nisdomainname"
 | 
			
		||||
		nisdomainname $nisdomainname
 | 
			
		||||
		eend $? "Failed to set the NIS domain name"
 | 
			
		||||
	fi
 | 
			
		||||
	if [ "$short" != "localhost" ]; then
 | 
			
		||||
		out="$out localhost"
 | 
			
		||||
	fi
 | 
			
		||||
	if [ "$hostname" != "localhost.localdomain" ]; then
 | 
			
		||||
		out="$out localhost.localdomain"
 | 
			
		||||
	fi
 | 
			
		||||
	[ -n "$aliases" ] && out="$out $aliases"
 | 
			
		||||
	ebegin "Configuring /etc/hosts"
 | 
			
		||||
	[ -e /etc/hosts ] && sed -i -e '/[[:space:]]*127.0.0.1[[:space:]]/d' -e '/[[:space:]]*::1[[:space:]]/d' /etc/hosts
 | 
			
		||||
	cat <<END >> /etc/hosts
 | 
			
		||||
127.0.0.1	$out
 | 
			
		||||
::1		$out
 | 
			
		||||
END
 | 
			
		||||
	chmod 0644 /etc/hosts
 | 
			
		||||
	eend $?
 | 
			
		||||
	[ "$RC_SYS" = "LXC" ] && return 0
 | 
			
		||||
	ebegin "Setting hostname to $hostname"
 | 
			
		||||
	hostname "$hostname"
 | 
			
		||||
	eend $? "Failed to set the hostname"
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ depend()
 | 
			
		||||
	need fsck
 | 
			
		||||
	use lvm modules mtab
 | 
			
		||||
	after lvm modules
 | 
			
		||||
	keyword -jail -openvz -prefix -vserver -lxc
 | 
			
		||||
	keyword -jail -prefix -vserver -lxc
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
start()
 | 
			
		||||
 
 | 
			
		||||
@@ -1,35 +0,0 @@
 | 
			
		||||
#!@SBINDIR@/runscript
 | 
			
		||||
# Copyright (c) 2013 William Hubbs <w.d.hubbs@gmail.com>
 | 
			
		||||
# Released under the 2-clause BSD license.
 | 
			
		||||
 | 
			
		||||
description="Configures the loopback interface."
 | 
			
		||||
 | 
			
		||||
depend()
 | 
			
		||||
{
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
start()
 | 
			
		||||
{
 | 
			
		||||
	if [ "$RC_UNAME" = Linux ]; then
 | 
			
		||||
		ebegin "Bringing up network interface lo"
 | 
			
		||||
		if type ip > /dev/null 2>&1; then
 | 
			
		||||
			ip addr add 127.0.0.1/8 dev lo brd + scope host
 | 
			
		||||
			ip route add 127.0.0.0/8 dev lo scope host
 | 
			
		||||
			ip link set lo up
 | 
			
		||||
		else
 | 
			
		||||
			ifconfig lo 127.0.0.1 netmask 255.0.0.0
 | 
			
		||||
			route add -net 127.0.0.0 netmask 255.0.0.0 gw 127.0.0.1
 | 
			
		||||
		fi
 | 
			
		||||
	else
 | 
			
		||||
		ebegin "Bringing up network interface lo0"
 | 
			
		||||
		ifconfig lo0 127.0.0.1 netmask 255.0.0.0
 | 
			
		||||
		route -q add -inet 127.0.0.0 -netmask 255.0.0.0 127.0.0.1
 | 
			
		||||
	fi
 | 
			
		||||
	eend $?
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
stop()
 | 
			
		||||
{
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
@@ -1,11 +1,11 @@
 | 
			
		||||
#!@SBINDIR@/runscript
 | 
			
		||||
#!@PREFIX@/sbin/runscript
 | 
			
		||||
# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
 | 
			
		||||
# Released under the 2-clause BSD license.
 | 
			
		||||
 | 
			
		||||
depend()
 | 
			
		||||
{
 | 
			
		||||
	before bootmisc logger
 | 
			
		||||
	keyword -lxc -prefix -vserver
 | 
			
		||||
	keyword -lxc -vserver
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
start()
 | 
			
		||||
@@ -15,6 +15,14 @@ start()
 | 
			
		||||
	ebegin "Configuring kernel parameters"
 | 
			
		||||
	eindent
 | 
			
		||||
 | 
			
		||||
	# default sysctl System V max shared memory to 1/4 of RAM:
 | 
			
		||||
	mem_bytes=`awk '/MemTotal:/ { printf "%0.f",$2 * 1024}' /proc/meminfo`
 | 
			
		||||
	mem_max=`expr $mem_bytes / 4`
 | 
			
		||||
	page_size=`getconf PAGE_SIZE`
 | 
			
		||||
	shmall=`expr $mem_bytes / $page_size`
 | 
			
		||||
	sysctl kernel.shmmax=$mem_max > /dev/null
 | 
			
		||||
	sysctl kernel.shmall=$shmall > /dev/null
 | 
			
		||||
 | 
			
		||||
	for conf in @SYSCONFDIR@/sysctl.conf @SYSCONFDIR@/sysctl.d/*.conf; do
 | 
			
		||||
		if [ -r "$conf" ]; then
 | 
			
		||||
			vebegin "applying $conf"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
include ../mk/net.mk
 | 
			
		||||
 | 
			
		||||
BOOT=		bootmisc fsck hostname localmount loopback \
 | 
			
		||||
BOOT=		bootmisc fsck hostname localmount \
 | 
			
		||||
		root swap swapfiles sysctl urandom ${BOOT-${OS}}
 | 
			
		||||
DEFAULT=	local netmount
 | 
			
		||||
SHUTDOWN=	savecache ${SHUTDOWN-${OS}}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user