first commit

This commit is contained in:
STP
2019-11-26 21:36:24 +01:00
commit d9ad30ccf3
2899 changed files with 168823 additions and 0 deletions

View File

@ -0,0 +1,9 @@
# alsa-utils - compatibility job for sysvinit dependencies
#
# This job starts on restoring and stops on storing alsa sound card
# state to signal startpar about alsa-tuils dependency.
description "Signal sysvinit that alsa-utils tasks are complete"
start on started alsa-restore
stop on started alsa-store

14
etc_org/init/anacron.conf Normal file
View File

@ -0,0 +1,14 @@
# anacron - anac(h)ronistic cron
#
# anacron executes commands at specific periods, but does not assume that
# the machine is running continuously
description "anac(h)ronistic cron"
start on runlevel [2345]
stop on runlevel [!2345]
expect fork
normal exit 0
exec anacron -s

58
etc_org/init/apport.conf Normal file
View File

@ -0,0 +1,58 @@
# apport - automatic crash report generation
#
# While this job is active, core dumps will captured by apport and
# used to generate automatic crash reports.
description "automatic crash report generation"
start on runlevel [2345]
stop on runlevel [!2345]
env enabled=1
pre-start script
# don't start in containers
systemd-detect-virt --quiet --container && exit 0 || true
. /etc/default/apport
[ "$enabled" = "1" ] || [ "$force_start" = "1" ] || exit 0
mkdir -p -m 1777 /var/crash
# check for kernel crash dump, convert it to apport report
if [ -e /var/crash/vmcore ] || [ -n "`ls /var/crash | egrep ^[0-9]{12}$`" ]
then
/usr/share/apport/kernel_crashdump || true
fi
# check for incomplete suspend/resume or hibernate
if [ -e /var/lib/pm-utils/status ]
then
/usr/share/apport/apportcheckresume || true
rm -f /var/lib/pm-utils/status
rm -f /var/lib/pm-utils/resume-hang.log
fi
echo "|/usr/share/apport/apport %p %s %c %P" > /proc/sys/kernel/core_pattern
echo 2 > /proc/sys/fs/suid_dumpable
end script
post-stop script
# don't stop in containers
systemd-detect-virt --quiet --container && exit 0 || true
# Check for a hung resume. If we find one try and grab everything
# we can to aid in its discovery
if [ -e /var/lib/pm-utils/status ]
then
ps -wwef > /var/lib/pm-utils/resume-hang.log
fi
if [ "`dd if=/proc/sys/kernel/core_pattern count=1 bs=1 2>/dev/null`" != "|" ]
then
exit 1
else
echo 0 > /proc/sys/fs/suid_dumpable
echo "core" > /proc/sys/kernel/core_pattern
fi
end script

View File

@ -0,0 +1,6 @@
author "Dmitrijs Ledkovs <dmitrijs.ledkovs@canonical.com>"
description "Reload cups, upon starting avahi-daemon to make sure remote queues are populated"
start on started avahi-daemon
task
exec reload cups

View File

@ -0,0 +1,23 @@
# avahi-daemon - mDNS/DNS-SD daemon
#
# The Avahi daemon provides mDNS/DNS-SD discovery support (Bonjour/Zeroconf)
# allowing applications to discover services on the network.
description "mDNS/DNS-SD daemon"
start on (filesystem
and started dbus)
stop on stopping dbus
expect daemon
respawn
pre-start script
/lib/init/apparmor-profile-load usr.sbin.avahi-daemon
end script
script
opts="-D"
[ -e "/etc/eucalyptus/avahi-daemon.conf" ] && opts="${opts} -f /etc/eucalyptus/avahi-daemon.conf"
exec avahi-daemon ${opts}
end script

View File

@ -0,0 +1,15 @@
# avahi-dnsconfd - unicast DNS configuration daemon
#
# The avahi-dnsconfd daemon provides DNS configuration using mDNS in a
# DHCP-like fashion
description "unicast DNS configuration daemon"
start on (filesystem
and started avahi-daemon)
stop on stopping avahi-daemon
expect daemon
respawn
exec avahi-dnsconfd -D

View File

@ -0,0 +1,46 @@
# bluez - bluetooth daemon
description "bluetooth daemon"
start on started dbus
stop on stopping dbus
env UART_CONF=/etc/bluetooth/uart
env RFCOMM_CONF=/etc/bluetooth/rfcomm.conf
respawn
exec /usr/sbin/bluetoothd
post-start script
[ "$VERBOSE" = no ] && redirect='>/dev/null 2>&1' || redirect=
# start_uarts()
if [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];
then
grep -v '^#' $UART_CONF | while read i; do
eval "/usr/sbin/hciattach $i $redirect" || :
done
fi
# start_rfcomm()
if [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;
then
# rfcomm must always succeed for now: users
# may not yet have an rfcomm-enabled kernel
eval "/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect" || :
fi
end script
post-stop script
# stop_uarts()
logger -t bluez "Stopping uarts"
killall hciattach >/dev/null 2>&1 || :
# stop_rfcomm()
logger -t bluez "Stopping rfcomm"
if [ -x /usr/bin/rfcomm ];
then
eval "/usr/bin/rfcomm unbind all $redirect" || :
fi
end script

View File

@ -0,0 +1,12 @@
# console-font - set console font
#
# Set the console font, in case the similar udev rule races with Plymouth
# and thus fails to do it.
description "set console font"
start on starting plymouth-splash
task
exec /lib/udev/console-setup-tty fbcon

View File

@ -0,0 +1,16 @@
# console-setup - set console keymap
#
# Set the console keyboard as early as possible so that the administrator
# can interact with the system during file system checks. The keymap may be
# set on any virtual console as long as it isn't in raw mode; loadkeys will
# go and look for one such, and fail if it can't find one.
description "set console keymap"
start on (virtual-filesystems
or starting rcS
or starting mountall-shell)
task
exec loadkeys /etc/console-setup/cached.kmap.gz

14
etc_org/init/cron.conf Normal file
View File

@ -0,0 +1,14 @@
# cron - regular background program processing daemon
#
# cron is a standard UNIX program that runs user-specified programs at
# periodic scheduled times
description "regular background program processing daemon"
start on runlevel [2345]
stop on runlevel [!2345]
expect fork
respawn
exec cron

View File

@ -0,0 +1,25 @@
# cryptdisks - enable encrypted block devices
description "enable encrypted block devices"
start on block-device-added ID_FS_USAGE=crypto
instance $DEVNAME
task
script
if [ -r /lib/cryptsetup/cryptdisks.functions ]; then
. /lib/cryptsetup/cryptdisks.functions
else
exit 0
fi
case "$CRYPTDISKS_ENABLE" in
[Nn]*)
exit 1
;;
esac
INITSTATE=udev
crypttab_start_one_disk "$DEVNAME"
end script

View File

@ -0,0 +1,45 @@
# cryptdisks - enable encrypted block devices
#
# Sweep up any devices in /etc/crypttab that have not yet been started at
# the end of udev coldplugging; this partly duplicates the cryptdisks-udev
# job, but is necessary because:
# - some devices may not be registered as ID_FS_USAGE=crypto by udev (e.g.,
# random-encrypted devices), but we don't want to call the upstart job
# for every single block device
# - some devices can only be decrypted after other devices are decrypted and
# mounted first, so we need a two-pass system (like
# /etc/init.d/cryptdisks{,-early} previously)
#
# This job currently still does not guarantee a race-free startup; instances
# of cryptdisks-udev may be started in parallel with this job.
description "enable remaining boot-time encrypted block devices"
start on stopped udevtrigger or container
# Currently stopping is a no-op, so we can stop this anywhere during the
# shutdown sequence. We let the cryptdisks-early init script take care of
# device teardown instead; it happens that the distinction between the
# 'cryptdisks' and 'cryptdisks-early' jobs is irrelevant on shutdown because
# the only sequencing difference is lvm2, which has no init script that's
# called on shutdown.
stop on unmounted-remote-filesystems
task
pre-start script
if [ -r /lib/cryptsetup/cryptdisks.functions ]; then
. /lib/cryptsetup/cryptdisks.functions
else
exit 0
fi
case "$CRYPTDISKS_ENABLE" in
[Nn]*)
exit 1
;;
esac
INITSTATE="init"
do_start
end script

View File

@ -0,0 +1,20 @@
# cups-browsed - Bonjour remote printer browsing daemon
description "cups-browsed - Bonjour remote printer browsing daemon"
author "Till Kamppeter <till.kamppeter@gmail.com>"
start on (filesystem
and (started cups or runlevel [2345]))
stop on runlevel [016]
respawn
respawn limit 3 240
pre-start script
[ -x /usr/sbin/cups-browsed ]
if [ -x /lib/init/apparmor-profile-load ]; then
/lib/init/apparmor-profile-load usr.sbin.cups-browsed
fi
end script
exec /usr/sbin/cups-browsed

58
etc_org/init/cups.conf Normal file
View File

@ -0,0 +1,58 @@
# cups - CUPS Printing spooler and server
description "CUPS printing spooler/server"
author "Michael Sweet <msweet@apple.com>"
start on (filesystem
and (started dbus or runlevel [2345]))
stop on runlevel [016]
respawn
respawn limit 3 12
pre-start script
[ -x /usr/sbin/cupsd ]
# load modules for parallel port support
if [ -r /etc/default/cups ]; then
. /etc/default/cups
fi
if [ "$LOAD_LP_MODULE" = "yes" -a -f /usr/lib/cups/backend/parallel \
-a -f /proc/modules -a -x /sbin/modprobe ]; then
modprobe -q -b lp || true
modprobe -q -b ppdev || true
modprobe -q -b parport_pc || true
fi
mkdir -p /var/run/cups/certs
if [ -x /lib/init/apparmor-profile-load ]; then
/lib/init/apparmor-profile-load usr.sbin.cupsd
fi
end script
exec /usr/sbin/cupsd -f
post-start script
# wait until daemon is ready
timeout=60
while [ ! -e /var/run/cups/cups.sock ]; do
sleep 0.5
timeout=$((timeout-1))
if [ "$timeout" -eq 0 ]; then
echo "cupsd failed to create /var/run/cups/cups.sock, skipping automatic printer configuration" >&2
exit 0
fi
done
# coldplug USB printers
if ! /lib/udev/udev-configure-printer enumerate 2>/dev/null; then
if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then
for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \
--attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \
udevadm trigger --verbose --dry-run --subsystem-match=usb \
--sysname-match='lp[0-9]*' 2>/dev/null || true`; do
/lib/udev/udev-configure-printer add "${printer#/sys}"
done
fi
fi
end script

25
etc_org/init/dbus.conf Normal file
View File

@ -0,0 +1,25 @@
# dbus - D-Bus system message bus
#
# The D-Bus system message bus allows system daemons and user applications
# to communicate.
description "D-Bus system message bus"
start on filesystem
stop on deconfiguring-networking
expect fork
respawn
pre-start script
mkdir -p /var/run/dbus
chown messagebus:messagebus /var/run/dbus
exec dbus-uuidgen --ensure
end script
exec dbus-daemon --system --fork
post-start exec kill -USR1 1
post-stop exec rm -f /var/run/dbus/pid

View File

@ -0,0 +1,57 @@
# Init script for friendly recovery
start on recovery
console owner
task
emits recovery
emits startup
emits mounted
pre-start script
if plymouth --ping; then
plymouth hide-splash || true
fi
# Try to set the hostname and initialize the console
start hostname || true
start console-setup || true
start setvtrgb || true
# Make sure /run contains the required directories for the
# recovery menu options
mkdir -p /run/lock /run/shm || true
# Emit the mounted event to trigger resolvconf and mounted-run
initctl emit mounted MOUNTPOINT=/run || true
# Finally start udev
start udev || true
udevadm trigger --action=add || true
udevadm settle || true
# And turn off kernel messages (to avoid corrupting the menu)
dmesg --console-off || true
end script
script
# Only start friendly-recovery when booting in recovery mode
if ! grep -q "recovery" /proc/cmdline; then
exit 0
fi
if [ -x /lib/recovery-mode/recovery-menu ]; then
exec /lib/recovery-mode/recovery-menu
else
exec /sbin/sulogin
fi
end script
post-stop script
if plymouth --ping; then
plymouth show-splash
fi
initctl emit startup
end script

View File

@ -0,0 +1,12 @@
#
# This task is run on startup to set the system hostname from /etc/hostname,
# falling back to "localhost" if that file is not readable or is empty and
# no hostname has yet been set.
description "set system hostname"
start on startup
task
exec hostname -b -F /etc/hostname

View File

@ -0,0 +1,9 @@
# hostname.sh - compatibility job for sysvinit dependencies
#
# This job runs once hostname job finished running, to signal startpar
# that other rcS jobs relying on the historic hostname.sh interface
# can continue.
description "Signal sysvinit that hostname is set"
start on stopped hostname

View File

@ -0,0 +1,19 @@
# hwclock-save - save system clock to hardware clock
#
# This task saves the time from the system clock back to the hardware
# clock on shutdown.
description "save system clock to hardware clock"
start on runlevel [06]
task
script
# BADYEAR can be in either file
. /etc/default/rcS
[ ! -r /etc/default/hwclock ] || . /etc/default/hwclock
grep -qw LOCAL /etc/adjtime 2>/dev/null && tz="--localtime" || tz="--utc"
[ "$BADYEAR" = "yes" ] && badyear="--badyear"
exec hwclock --rtc=/dev/rtc0 --systohc $tz --noadjfile $badyear
end script

21
etc_org/init/hwclock.conf Normal file
View File

@ -0,0 +1,21 @@
# hwclock - adjust system clock and timezone
#
# The hwclock task adjusts the system clock when the hardware clock is
# set to localtime (e.g. when dual-booting with Windows), and also
# ensures that the system timezone is set so that timestamps are written
# to FAT devices.
description "adjust system clock and timezone"
start on starting mountall
task
script
# BADYEAR can be in either file
. /etc/default/rcS
[ ! -r /etc/default/hwclock ] || . /etc/default/hwclock
grep -qw LOCAL /etc/adjtime 2>/dev/null && tz="--localtime" || tz="--utc"
[ "$BADYEAR" = "yes" ] && badyear="--badyear"
exec hwclock --systz $tz --noadjfile $badyear
end script

View File

@ -0,0 +1,3 @@
description "Mask /etc/init.d/hwclock.sh, this is done by /etc/init/hwclock.conf"
start on starting hwclock

View File

@ -0,0 +1,25 @@
# irqbalance - Daemon to balance interrupts for SMP system
# irqbalance is a daemon to balance interrupts across multiple CPUs, which
# can lear to better performance and IO balance on SMP systems.
description "CPU interrupts balancing daemon"
author "Chuck Short <zulcss@ubuntu.com>"
start on runlevel [2345] and not-container
stop on runlevel [!2345]
expect fork
script
test -f /etc/default/irqbalance && . /etc/default/irqbalance
test "$ENABLED" != "0" || exit 0
if test "$ONESHOT" != "0"; then
DOPTIONS="--oneshot"
fi
exec /usr/sbin/irqbalance $OPTIONS $DOPTIONS
end script

24
etc_org/init/kmod.conf Normal file
View File

@ -0,0 +1,24 @@
# kmod - load modules from /etc/modules
#
# This task loads the kernel modules specified in the /etc/modules file
description "load modules from /etc/modules"
start on (startup
and started udev)
task
script
[ -f /etc/modules ] && files="/etc/modules" || files=""
hash="#"
dirs="/etc/modules-load.d /run/modules-load.d /lib/modules-load.d"
for dir in $dirs; do
files="$files $(run-parts --list --regex='\.conf$' $dir 2> /dev/null || true)"
done
for file in $files; do
while read module args; do
[ -n "$module" ] && [ "${module#${hash}}" = "${module}" ] || continue
modprobe $module $args || :
done < $file
done
end script

63
etc_org/init/lightdm.conf Normal file
View File

@ -0,0 +1,63 @@
# LightDM - light Display Manager
#
# The display manager service manages the X servers running on the
# system, providing login and auto-login services
#
# based on gdm upstart script
description "LightDM Display Manager"
author "Robert Ancell <robert.ancell@canonical.com>"
start on ((filesystem
and runlevel [!06]
and started dbus
and plymouth-ready)
or runlevel PREVLEVEL=S)
stop on runlevel [016]
respawn
respawn limit 2 15
emits login-session-start
emits desktop-session-start
emits desktop-shutdown
script
if [ -n "$UPSTART_EVENTS" ]
then
# Check kernel command-line for inhibitors, unless we are being called
# manually
for ARG in $(cat /proc/cmdline); do
if [ "$ARG" = "text" ]; then
plymouth quit || :
stop
exit 0
fi
done
[ ! -f /etc/X11/default-display-manager -o "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/bin/lightdm" -o "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/lightdm" ] || { stop; exit 0; }
if [ "$RUNLEVEL" = S -o "$RUNLEVEL" = 1 ]
then
# Single-user mode
plymouth quit || :
exit 0
fi
fi
exec lightdm
end script
post-start script
sleep 5
clear > /dev/tty7
end script
post-stop script
clear > /dev/tty7
sleep 1
if [ "$UPSTART_STOP_EVENTS" = runlevel ]; then
initctl emit desktop-shutdown
fi
end script

View File

@ -0,0 +1,19 @@
# network-interface-container - woarkound for missing events in container
#
# This service emits missing net-device-added events for containers.
# It's needed in cases where devices are created before the container
# starts and so won't get a udev event.
description "workaround for missing events in container"
start on container
emits net-device-added
task
script
case "$CONTAINER" in
lxc|lxc-libvirt|openvz)
initctl emit --no-wait net-device-added INTERFACE=lo || true
;;
esac
end script

View File

@ -0,0 +1,37 @@
# network-interface-security - configure network device security
#
# This is a one-time start-up script to load AppArmor profiles needed
# before the network comes up.
description "configure network device security"
# In order to avoid upstart bug LP: #447654, we cannot have an AND
# statement here (with the ORs). An "and virtual-filesystems" is desired
# here to make sure that the securityfs is mounted, but since each of the
# ORed services already require virtual-filesystems be mounted, this is safe:
start on (starting network-interface
or starting network-manager
or starting networking)
stop on (stopped network-interface JOB=$JOB INTERFACE=$INTERFACE
or stopped network-manager JOB=$JOB
or stopped networking JOB=$JOB)
# In order to handle the lack of upstart feature LP: #568860, we need to
# run multiple times, for each of the above "starting" service instances, or
# else another one might run while we're running, and not wait for us to
# finish.
instance $JOB${INTERFACE:+/}${INTERFACE:-}
# Since we need these profiles to be loaded before any of the above services
# begin running, this service must be a pre-start so that its pre-start
# script finishes before the above services' start scripts begin.
pre-start script
[ -f /run/network-interface-security ] && exit 0 # already ran
[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD
[ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor
[ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser
for link in /etc/apparmor/init/network-interface-security/* ; do
[ -L $link ] && /sbin/apparmor_parser -r -W $link || true
done
> /run/network-interface-security
end script

View File

@ -0,0 +1,34 @@
# network-interface - configure network device
#
# This service causes network devices to be brought up or down as a result
# of hardware being added or removed, including that which isn't ordinarily
# removable.
description "configure network device"
emits net-device-up
emits net-device-down
emits static-network-up
start on net-device-added
stop on net-device-removed INTERFACE=$INTERFACE
instance $INTERFACE
export INTERFACE
pre-start script
if [ "$INTERFACE" = lo ]; then
# bring this up even if /etc/network/interfaces is broken
ifconfig lo 127.0.0.1 up || true
initctl emit -n net-device-up \
IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true
fi
mkdir -p /run/network
ifup --allow auto $INTERFACE
ifup --allow hotplug $INTERFACE
end script
post-stop script
ifdown --force --allow auto $INTERFACE
ifdown --force --allow hotplug $INTERFACE
end script

View File

@ -0,0 +1,24 @@
# network-manager - network connection manager
#
# The Network Manager daemon manages the system's network connections,
# automatically switching between the best available.
description "network connection manager"
start on (local-filesystems
and started dbus
and static-network-up)
stop on stopping dbus
expect fork
respawn
script
# set $LANG so that messages appearing on the GUI will be translated. See LP: 875017
if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG LANGUAGE LC_MESSAGES LC_ALL
fi
exec NetworkManager
end script

View File

@ -0,0 +1,80 @@
# networking - configure virtual network devices
#
# This task causes virtual network devices that do not have an associated
# kernel object to be started on boot.
description "configure virtual network devices"
emits static-network-up
emits net-device-up
emits deconfiguring-networking
start on (local-filesystems
and (stopped udevtrigger or container)) or runlevel [2345] or stopped networking RESULT=failed PROCESS=post-stop EXIT_STATUS=100
stop on unmounted-remote-filesystems
pre-start script
if [ "$UPSTART_EVENTS" = "stopped" ] && [ "$UPSTART_JOB" = "networking" ] && [ "$EXIT_STATUS" = "100" ]; then
exit 0
fi
mkdir -p /run/network
ifup -a
end script
post-stop script
if [ -z "$UPSTART_STOP_EVENTS" ]; then
echo "Stopping or restarting the networking job is not supported."
echo "Use ifdown & ifup to reconfigure desired interface."
exit 100
fi
log_warning_msg() {
echo $*
}
# These checks were taken from the Debian ifupdown.networking.init script
check_network_file_systems() {
[ -e /proc/mounts ] || return 0
if [ -e /etc/iscsi/iscsi.initramfs ]; then
log_warning_msg "not deconfiguring network interfaces: iSCSI root is mounted."
exit 0
fi
while read DEV MTPT FSTYPE REST; do
case $DEV in
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
log_warning_msg "not deconfiguring network interfaces: network devices still mounted."
exit 0
;;
esac
case $FSTYPE in
nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
log_warning_msg "not deconfiguring network interfaces: network file systems still mounted."
exit 0
;;
esac
done < /proc/mounts
}
check_network_swap() {
[ -e /proc/swaps ] || return 0
while read DEV MTPT FSTYPE REST; do
case $DEV in
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
log_warning_msg "not deconfiguring network interfaces: network swap still mounted."
exit 0
;;
esac
done < /proc/swaps
}
check_network_file_systems
check_network_swap
# Anything that manages network interfaces *MUST* wait for this event
initctl emit deconfiguring-networking
ifdown -a --exclude=lo
end script

View File

@ -0,0 +1,61 @@
# oem-config - End-user configuration after initial OEM installation
#
# Run on the first boot after shipping to the end user to reconfigure the
# system for them; removes itself thereafter.
description "End-user configuration after initial OEM installation"
author "Ubuntu Installer Team <ubuntu-installer@lists.ubuntu.com>"
start on (starting gdm
or starting kdm
or starting xdm
or starting lxdm
or starting lightdm
or starting oem-config-debconf)
stop on (runlevel [06]
or stopping gdm
or stopping kdm
or stopping xdm
or stopping lxdm
or stopping lightdm)
emits starting-dm
task
normal exit 0 1
console output
script
[ -f /var/lib/oem-config/run ]
frontend=
type oem-config-firstboot >/dev/null 2>&1 || exit 0
debug=
automatic=
for x in $(cat /proc/cmdline); do
case $x in
debug-oem-config)
debug=--debug
;;
# We never want to run the oem-config job in the live environment
# (as is the case in some custom configurations) or in recovery
# mode.
boot=casper|single)
exit 0
;;
ubiquity/frontend=*)
frontend="${x#*=}"
export FRONTEND=$frontend
;;
automatic-oem-config)
automatic=--automatic
;;
esac
done
initctl emit starting-dm DM=oem-config-dm
exec oem-config-firstboot $debug $automatic
end script

18
etc_org/init/passwd.conf Normal file
View File

@ -0,0 +1,18 @@
# passwd - clear locks on passwd and related files
#
# Copyright 2012 Canonical Ltd.
# Author: Dmitrijs Ledkovs
#
# This helper clears locks on passwd to avoid million duplicate bug reports
# like this one: https://launchpad.net/bugs/523896
# Ideally we'd know what lock-up, and doesn't clear the lock, and fix that.
# But it appears to be safe enough to clear them unconditionally on boot.
#
description "Clear passwd locks"
start on filesystem
task
exec rm -f /etc/gshadow.lock /etc/shadow.lock /etc/passwd.lock /etc/group.lock /etc/subuid.lock /etc/subgid.lock

View File

@ -0,0 +1,16 @@
# procps - set sysctls from /etc/sysctl.conf
#
# This task sets kernel sysctl variables from /etc/sysctl.conf and
# /etc/sysctl.d
description "set sysctls from /etc/sysctl.conf"
instance $UPSTART_EVENTS
env UPSTART_EVENTS=
start on virtual-filesystems or static-network-up
task
script
cat /etc/sysctl.d/*.conf /etc/sysctl.conf | sysctl -e -p -
end script

5
etc_org/init/procps.conf Normal file
View File

@ -0,0 +1,5 @@
# procps - set sysctls from /etc/sysctl.conf
#
# signal startpar that procps has run
start on started procps-instance

View File

@ -0,0 +1,19 @@
# upstart script for resolvconf
description "Initialize or finalize resolvconf"
start on mounted MOUNTPOINT=/run
stop on runlevel [06]
pre-start script
mkdir -p /run/resolvconf/interface
# Request a postponed update (needed in case the base file has content).
touch /run/resolvconf/postponed-update
# Enable updates and perform the postponed update.
resolvconf --enable-updates
end script
post-stop script
resolvconf --disable-updates
end script

View File

@ -0,0 +1,17 @@
# rfkill-restore - restore software RF kill switch state
description "restore software rfkill state"
start on local-filesystems
task
script
if [ ! -d /sys/class/rfkill ]; then
exit 0
fi
for device in /sys/class/rfkill/*; do
[ ! -d $device ] && continue
/lib/systemd/systemd-rfkill load `basename $device`
done
end script

View File

@ -0,0 +1 @@
manual

View File

@ -0,0 +1,18 @@
# rfkill-store - store software RF kill switch state
description "store software rfkill state"
start on runlevel [016]
task
script
if [ ! -d /sys/class/rfkill ]; then
exit 0
fi
for device in /sys/class/rfkill/*; do
[ ! -d $device ] && continue
/lib/systemd/systemd-rfkill save `basename $device`
done
end script

View File

@ -0,0 +1 @@
manual

21
etc_org/init/rsyslog.conf Normal file
View File

@ -0,0 +1,21 @@
# rsyslog - system logging daemon
#
# rsyslog is an enhanced multi-threaded replacement for the traditional
# syslog daemon, logging messages from applications
description "system logging daemon"
start on filesystem
stop on runlevel [06]
expect fork
respawn
pre-start script
/lib/init/apparmor-profile-load usr.sbin.rsyslogd
end script
script
. /etc/default/rsyslog
exec rsyslogd $RSYSLOGD_OPTIONS
end script

View File

@ -0,0 +1,9 @@
# setvtrgb - set virtual terminal colors
#
# This job configures the virtual terminal console colors
author "Dustin Kirkland <kirkland@canonical.com>"
start on (started plymouth-splash or started tty1)
exec setvtrgb /etc/vtrgb

29
etc_org/init/ssh.conf Normal file
View File

@ -0,0 +1,29 @@
# ssh - OpenBSD Secure Shell server
#
# The OpenSSH server provides secure shell access to the system.
description "OpenSSH server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
umask 022
env SSH_SIGSTOP=1
expect stop
# 'sshd -D' leaks stderr and confuses things in conjunction with 'console log'
console none
pre-start script
test -x /usr/sbin/sshd || { stop; exit 0; }
test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }
mkdir -p -m0755 /var/run/sshd
end script
# if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
# 'exec' line here instead
exec /usr/sbin/sshd -D

14
etc_org/init/udev.conf Normal file
View File

@ -0,0 +1,14 @@
# udev - device node and kernel event manager
#
# The udev daemon receives events from the kernel about changes in the
# /sys filesystem and manages the /dev filesystem.
description "device node and kernel event manager"
start on virtual-filesystems
stop on runlevel [06]
expect fork
respawn
exec /lib/systemd/systemd-udevd --daemon

View File

@ -0,0 +1,13 @@
# udevmonitor - log initial device creation
#
# The set of devices created in the "cold plug" pass is generally
# useful for debugging, so we monitor this and create a log file
# from that.
description "log initial device creation"
start on (startup
and starting udevtrigger)
stop on stopped udevtrigger
exec /sbin/udevadm monitor -e >/run/udev/udev.log

View File

@ -0,0 +1,16 @@
# udevtrigger - cold plug devices
#
# By the time udevd starts, we've already missed all of the events for
# the devices populated in /sys. This task causes the kernel to resend
# them.
description "cold plug devices"
start on (startup
and started udev
and not-container)
task
exec udevadm trigger --action=add
post-stop exec udevadm settle

18
etc_org/init/ufw.conf Normal file
View File

@ -0,0 +1,18 @@
# ufw - Uncomplicated Firewall
#
# The Uncomplicated Firewall is a front-end for iptables, to make managing a
# Netfilter firewall easier.
description "Uncomplicated firewall"
# Make sure we start before an interface receives traffic
start on (starting network-interface
or starting network-manager
or starting networking)
stop on runlevel [!023456]
console output
pre-start exec /lib/ufw/ufw-init start quiet
post-stop exec /lib/ufw/ufw-init stop

View File

@ -0,0 +1,19 @@
# ureadahead - Read required files in advance for other mountpoints
#
# Runs the über-readahead daemon which reads data about files required
# during boot and reads them into the page cache in advance of their
# use.
description "Read required files in advance (for other mountpoints)"
start on mounted DEVICE=[/UL]* MOUNTPOINT=/?*
# Forks into the background both when reading from disk and when profiling
# (HDD mode won't fork, but that's ok because we'll wait for it in spawned).
expect fork
# Don't treat a normal exit after reading finishes as a failure, and
# don't treat a missing pack file as an error either
normal exit 0 4
exec /sbin/ureadahead --daemon $MOUNTPOINT

View File

@ -0,0 +1,28 @@
# ureadahead - Read required files in advance
#
# Runs the über-readahead daemon which reads data about files required
# during boot and reads them into the page cache in advance of their
# use.
description "Read required files in advance"
start on starting mountall
stop on stopped rc
# Forks into the background both when reading from disk and when profiling
# (HDD mode won't fork, but that's ok because we'll wait for it in spawned).
expect fork
# When profiling, give it three minutes after sending SIGTERM to write out
# the pack file.
kill timeout 180
# Don't treat a normal exit after reading finishes as a failure
normal exit 0
exec /sbin/ureadahead --daemon
# Normally ureadahead will exit on its own when it finishes, unless it's
# profiling - in which case we want to give the system another 45s to
# finish staring the desktop and other things.
pre-stop exec sleep 45

View File

@ -0,0 +1,6 @@
start on usb-modeswitch-upstart
task
env TMPDIR=/run
script
exec /usr/sbin/usb_modeswitch_dispatcher --switch-upstart $UMS_PARAM
end script

View File

@ -0,0 +1,18 @@
# whoopsie - crash report submission daemon
description "crash report submission daemon"
start on runlevel [2345]
stop on runlevel [!2345]
env CRASH_DB_URL=https://daisy.ubuntu.com
respawn
respawn limit 10 5
pre-start script
# Wait for network-manager if and only if it's installed.
status network-manager >/dev/null 2>&1 && start wait-for-state WAITER=whoopsie WAIT_FOR=network-manager WAIT_STATE=running || :
end script
exec whoopsie -f