From 732876299f4dccb4caa3a915879d2b5945bbdd42 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 2 Apr 2014 11:15:54 +0200 Subject: filehooker is now elchOS --- elchos/root-image/etc/collectd.conf | 84 ++++++++++++++++++++++ elchos/root-image/etc/fstab | 0 elchos/root-image/etc/hostname | 1 + elchos/root-image/etc/locale.conf | 1 + elchos/root-image/etc/pam.d/su | 6 ++ elchos/root-image/etc/sudoers.d/g_wheel | 1 + .../root-image/etc/systemd/scripts/choose-mirror | 26 +++++++ .../etc/systemd/system/choose-mirror.service | 10 +++ .../systemd/system/collectd.service.d/wait.conf | 2 + .../system/dhcpcd.service.d/force-reboot.conf | 2 + .../etc/systemd/system/elch-hostname.service | 11 +++ .../etc/systemd/system/etc-pacman.d-gnupg.mount | 8 +++ .../getty@tty1.service.d/run_krebs_secret.conf | 3 + .../hddtemp.service.d/monitor_all_disks.conf | 3 + .../system/ntpdate.service.d/set_hwclock.conf | 2 + .../etc/systemd/system/pacman-init.service | 15 ++++ .../etc/systemd/system/start-ncdc@.service | 13 ++++ .../systemd/system/tor-configure-hidden.service | 11 +++ elchos/root-image/etc/udev/rules.d/81-dhcpcd.rules | 1 + 19 files changed, 200 insertions(+) create mode 100644 elchos/root-image/etc/collectd.conf create mode 100644 elchos/root-image/etc/fstab create mode 100644 elchos/root-image/etc/hostname create mode 100644 elchos/root-image/etc/locale.conf create mode 100644 elchos/root-image/etc/pam.d/su create mode 100644 elchos/root-image/etc/sudoers.d/g_wheel create mode 100755 elchos/root-image/etc/systemd/scripts/choose-mirror create mode 100644 elchos/root-image/etc/systemd/system/choose-mirror.service create mode 100644 elchos/root-image/etc/systemd/system/collectd.service.d/wait.conf create mode 100644 elchos/root-image/etc/systemd/system/dhcpcd.service.d/force-reboot.conf create mode 100644 elchos/root-image/etc/systemd/system/elch-hostname.service create mode 100644 elchos/root-image/etc/systemd/system/etc-pacman.d-gnupg.mount create mode 100644 elchos/root-image/etc/systemd/system/getty@tty1.service.d/run_krebs_secret.conf create mode 100644 elchos/root-image/etc/systemd/system/hddtemp.service.d/monitor_all_disks.conf create mode 100644 elchos/root-image/etc/systemd/system/ntpdate.service.d/set_hwclock.conf create mode 100644 elchos/root-image/etc/systemd/system/pacman-init.service create mode 100644 elchos/root-image/etc/systemd/system/start-ncdc@.service create mode 100644 elchos/root-image/etc/systemd/system/tor-configure-hidden.service create mode 100644 elchos/root-image/etc/udev/rules.d/81-dhcpcd.rules (limited to 'elchos/root-image/etc') diff --git a/elchos/root-image/etc/collectd.conf b/elchos/root-image/etc/collectd.conf new file mode 100644 index 00000000..30480f2e --- /dev/null +++ b/elchos/root-image/etc/collectd.conf @@ -0,0 +1,84 @@ +#Hostname "elch_" +Interval 10 + +LoadPlugin syslog + + LogLevel info + + +LoadPlugin md +LoadPlugin cpu +LoadPlugin df +LoadPlugin disk +#LoadPlugin ping +LoadPlugin hddtemp +LoadPlugin interface +LoadPlugin load +LoadPlugin memory +LoadPlugin network +LoadPlugin uptime +LoadPlugin users +LoadPlugin write_graphite + + +# Device "/dev/sda1" +# Device "192.168.0.2:/mnt/nfs" + FSType "ext2" + FSType "ext3" + FSType "ext4" + FSType "btrfs" + FSType "ntfs" + FSType "ntfs-3g" + FSType "vfat" + + IgnoreSelected false + + + + Disk "/[vsh]d[abcdefg][12345678]/" + IgnoreSelected false + + + + Host "127.0.0.1" + Port 7634 + #TranslateDevicename false + + + + Interface "lo" + IgnoreSelected true + + + +# + #Host "elchhub.krebsco.de" + #Host "elchstats.krebsco.de" + #Interval 1.0 + #Timeout 0.9 +# TTL 255 +# SourceAddress "1.2.3.4" +# Device "eth0" +# MaxMissed -1 +# + + +# +# Sensor "it8712-isa-0290/temperature-temp1" +# Sensor "it8712-isa-0290/fanspeed-fan3" +# Sensor "it8712-isa-0290/voltage-in8" +# IgnoreSelected false +# + + + + + Host "elchstats.nsupdate.info" + Port "2003" + Prefix "elch." + #Postfix "" + EscapeCharacter "_" + StoreRates false + AlwaysAppendDS false + + diff --git a/elchos/root-image/etc/fstab b/elchos/root-image/etc/fstab new file mode 100644 index 00000000..e69de29b diff --git a/elchos/root-image/etc/hostname b/elchos/root-image/etc/hostname new file mode 100644 index 00000000..ef8963cd --- /dev/null +++ b/elchos/root-image/etc/hostname @@ -0,0 +1 @@ +filebitch diff --git a/elchos/root-image/etc/locale.conf b/elchos/root-image/etc/locale.conf new file mode 100644 index 00000000..01ec548f --- /dev/null +++ b/elchos/root-image/etc/locale.conf @@ -0,0 +1 @@ +LANG=en_US.UTF-8 diff --git a/elchos/root-image/etc/pam.d/su b/elchos/root-image/etc/pam.d/su new file mode 100644 index 00000000..a2910423 --- /dev/null +++ b/elchos/root-image/etc/pam.d/su @@ -0,0 +1,6 @@ +#%PAM-1.0 +auth sufficient pam_rootok.so +auth sufficient pam_wheel.so trust use_uid +auth required pam_unix.so +account required pam_unix.so +session required pam_unix.so diff --git a/elchos/root-image/etc/sudoers.d/g_wheel b/elchos/root-image/etc/sudoers.d/g_wheel new file mode 100644 index 00000000..8c45359f --- /dev/null +++ b/elchos/root-image/etc/sudoers.d/g_wheel @@ -0,0 +1 @@ +%wheel ALL=(ALL) NOPASSWD: ALL diff --git a/elchos/root-image/etc/systemd/scripts/choose-mirror b/elchos/root-image/etc/systemd/scripts/choose-mirror new file mode 100755 index 00000000..0ae08067 --- /dev/null +++ b/elchos/root-image/etc/systemd/scripts/choose-mirror @@ -0,0 +1,26 @@ +#!/bin/bash + +get_cmdline() { + local param + for param in $(< /proc/cmdline); do + case "${param}" in + $1=*) echo "${param##*=}"; + return 0 + ;; + esac + done +} + +mirror=$(get_cmdline mirror) +[[ $mirror = auto ]] && mirror=$(get_cmdline archiso_http_srv) +[[ $mirror ]] || exit 0 + +mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig +cat >/etc/pacman.d/mirrorlist << EOF +# +# Arch Linux repository mirrorlist +# Generated by archiso +# + +Server = ${mirror%%/}/\$repo/os/\$arch +EOF diff --git a/elchos/root-image/etc/systemd/system/choose-mirror.service b/elchos/root-image/etc/systemd/system/choose-mirror.service new file mode 100644 index 00000000..1e4d771d --- /dev/null +++ b/elchos/root-image/etc/systemd/system/choose-mirror.service @@ -0,0 +1,10 @@ +[Unit] +Description=Choose mirror from the kernel command line +ConditionKernelCommandLine=mirror + +[Service] +Type=oneshot +ExecStart=/etc/systemd/scripts/choose-mirror + +[Install] +WantedBy=multi-user.target diff --git a/elchos/root-image/etc/systemd/system/collectd.service.d/wait.conf b/elchos/root-image/etc/systemd/system/collectd.service.d/wait.conf new file mode 100644 index 00000000..05d8b43c --- /dev/null +++ b/elchos/root-image/etc/systemd/system/collectd.service.d/wait.conf @@ -0,0 +1,2 @@ +[Service] +ExecStartPre=/usr/bin/sleep 20 diff --git a/elchos/root-image/etc/systemd/system/dhcpcd.service.d/force-reboot.conf b/elchos/root-image/etc/systemd/system/dhcpcd.service.d/force-reboot.conf new file mode 100644 index 00000000..5b506341 --- /dev/null +++ b/elchos/root-image/etc/systemd/system/dhcpcd.service.d/force-reboot.conf @@ -0,0 +1,2 @@ +[Service] +StartLimitAction=reboot-force diff --git a/elchos/root-image/etc/systemd/system/elch-hostname.service b/elchos/root-image/etc/systemd/system/elch-hostname.service new file mode 100644 index 00000000..bcee7964 --- /dev/null +++ b/elchos/root-image/etc/systemd/system/elch-hostname.service @@ -0,0 +1,11 @@ +[Unit] +Description=change filehooker hostname +Before=network.target nss-lookup.target multi-user.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/krebs/bin/set-hostname.sh + +[Install] +WantedBy=multi-user.target diff --git a/elchos/root-image/etc/systemd/system/etc-pacman.d-gnupg.mount b/elchos/root-image/etc/systemd/system/etc-pacman.d-gnupg.mount new file mode 100644 index 00000000..4eab5513 --- /dev/null +++ b/elchos/root-image/etc/systemd/system/etc-pacman.d-gnupg.mount @@ -0,0 +1,8 @@ +[Unit] +Description=Temporary /etc/pacman.d/gnupg directory + +[Mount] +What=tmpfs +Where=/etc/pacman.d/gnupg +Type=tmpfs +Options=mode=0755 diff --git a/elchos/root-image/etc/systemd/system/getty@tty1.service.d/run_krebs_secret.conf b/elchos/root-image/etc/systemd/system/getty@tty1.service.d/run_krebs_secret.conf new file mode 100644 index 00000000..29e5be5f --- /dev/null +++ b/elchos/root-image/etc/systemd/system/getty@tty1.service.d/run_krebs_secret.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=-/usr/bin/agetty --autologin reaktor --noclear %I 38400 linux diff --git a/elchos/root-image/etc/systemd/system/hddtemp.service.d/monitor_all_disks.conf b/elchos/root-image/etc/systemd/system/hddtemp.service.d/monitor_all_disks.conf new file mode 100644 index 00000000..e6b8fcda --- /dev/null +++ b/elchos/root-image/etc/systemd/system/hddtemp.service.d/monitor_all_disks.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=/bin/bash -c "/usr/bin/hddtemp -dF hddtemp -d /dev/[vsh]d[a-z]" diff --git a/elchos/root-image/etc/systemd/system/ntpdate.service.d/set_hwclock.conf b/elchos/root-image/etc/systemd/system/ntpdate.service.d/set_hwclock.conf new file mode 100644 index 00000000..e57550c8 --- /dev/null +++ b/elchos/root-image/etc/systemd/system/ntpdate.service.d/set_hwclock.conf @@ -0,0 +1,2 @@ +[Service] +ExecStart=/usr/bin/hwclock --systohc --utc -w diff --git a/elchos/root-image/etc/systemd/system/pacman-init.service b/elchos/root-image/etc/systemd/system/pacman-init.service new file mode 100644 index 00000000..23b81445 --- /dev/null +++ b/elchos/root-image/etc/systemd/system/pacman-init.service @@ -0,0 +1,15 @@ +[Unit] +Description=Initializes Pacman keyring +Wants=haveged.service +After=haveged.service +Requires=etc-pacman.d-gnupg.mount +After=etc-pacman.d-gnupg.mount + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/pacman-key --init +ExecStart=/usr/bin/pacman-key --populate archlinux + +[Install] +WantedBy=multi-user.target diff --git a/elchos/root-image/etc/systemd/system/start-ncdc@.service b/elchos/root-image/etc/systemd/system/start-ncdc@.service new file mode 100644 index 00000000..7b5b1b8e --- /dev/null +++ b/elchos/root-image/etc/systemd/system/start-ncdc@.service @@ -0,0 +1,13 @@ +[Unit] +Description=ncdc autoconfig and startup for %i +After=network.target local-fs.target multi-user.target elch-hostname.service + +[Service] +Type=oneshot +RemainAfterExit=yes +#KillMode=none +ExecStart=/usr/bin/tmux new-session -n startup -d "/bin/sh /krebs/bin/start-ncdc.ship" +ExecStop=/usr/bin/sudo -u %i /usr/bin/tmux send-keys -t dcpp:ncdc "/quit" C-m + +[Install] +WantedBy=multi-user.target diff --git a/elchos/root-image/etc/systemd/system/tor-configure-hidden.service b/elchos/root-image/etc/systemd/system/tor-configure-hidden.service new file mode 100644 index 00000000..c9b8f20f --- /dev/null +++ b/elchos/root-image/etc/systemd/system/tor-configure-hidden.service @@ -0,0 +1,11 @@ +[Unit] +Description=Announce Tor Hidden Address +After=network.target nss-lookup.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/krebs/bin/tor_configure_hidden_service.ship + +[Install] +WantedBy=multi-user.target diff --git a/elchos/root-image/etc/udev/rules.d/81-dhcpcd.rules b/elchos/root-image/etc/udev/rules.d/81-dhcpcd.rules new file mode 100644 index 00000000..1c4053c0 --- /dev/null +++ b/elchos/root-image/etc/udev/rules.d/81-dhcpcd.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="net", ENV{INTERFACE}=="en*|eth*", ENV{SYSTEMD_WANTS}="dhcpcd@$name.service" -- cgit v1.2.3