From 025ad3b4a3cb0457977bc2c7cd8aeb98b58c9126 Mon Sep 17 00:00:00 2001 From: fbt Date: Thu, 17 Dec 2015 12:49:30 +0300 Subject: [PATCH] conf.d major changes --- conf.d/README | 7 ++----- conf.d/devfs-links | 8 ++++++++ conf.d/devfs-links.sh | 9 --------- conf.d/{dnscrypt.sh => dnscrypt} | 6 ------ conf.d/{dnscrypt-backup.sh => dnscrypt-backup} | 6 ------ conf.d/dropbear | 5 +++++ conf.d/dropbear.sh | 5 ----- conf.d/{fcgiwrap.sh => fcgiwrap} | 2 -- conf.d/kmscon | 4 ++++ conf.d/kmscon.sh | 9 --------- conf.d/ldm.sh | 5 ----- conf.d/ngetty | 2 ++ conf.d/ngetty.sh | 3 --- init.d/dnscrypt | 7 +++++++ init.d/dnscrypt-backup | 7 +++++++ init.d/dropbear | 1 - init.d/fcgiwrap | 1 + init.d/kmscon | 9 +++++++-- init.d/ldm | 5 ----- 19 files changed, 43 insertions(+), 58 deletions(-) create mode 100644 conf.d/devfs-links delete mode 100644 conf.d/devfs-links.sh rename conf.d/{dnscrypt.sh => dnscrypt} (57%) rename conf.d/{dnscrypt-backup.sh => dnscrypt-backup} (57%) create mode 100644 conf.d/dropbear delete mode 100644 conf.d/dropbear.sh rename conf.d/{fcgiwrap.sh => fcgiwrap} (55%) create mode 100644 conf.d/kmscon delete mode 100644 conf.d/kmscon.sh delete mode 100644 conf.d/ldm.sh create mode 100644 conf.d/ngetty delete mode 100644 conf.d/ngetty.sh delete mode 100644 init.d/ldm diff --git a/conf.d/README b/conf.d/README index 1675421..91d29e7 100644 --- a/conf.d/README +++ b/conf.d/README @@ -1,6 +1,3 @@ This is the directory additional service configuration is sourced from. -Basically you can override what's written in a service file from here -without directly modifying the service itself, making it easier to -update those as any local configuration should go here instead. - -I've provided a sample conf.d entry for dropbear to demostrate. +The service script itself must support these settings, as it's sourced +after the conf.d one. diff --git a/conf.d/devfs-links b/conf.d/devfs-links new file mode 100644 index 0000000..9d9b7ff --- /dev/null +++ b/conf.d/devfs-links @@ -0,0 +1,8 @@ +# Config for devfs-links + +cfg_links=( + '/proc/self/fd;/dev/fd' + '/proc/self/fd/0;/dev/stdin' + '/proc/self/fd/1;/dev/stdout' + '/proc/self/fd/2;/dev/stderr' +) diff --git a/conf.d/devfs-links.sh b/conf.d/devfs-links.sh deleted file mode 100644 index 9a9f096..0000000 --- a/conf.d/devfs-links.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env watchman -# Config for devfs-links - -cfg_links=( - '/proc/self/fd;/dev/fd' - '/proc/self/fd/0;/dev/stdin' - '/proc/self/fd/1;/dev/stdout' - '/proc/self/fd/2;/dev/stderr' - ) diff --git a/conf.d/dnscrypt.sh b/conf.d/dnscrypt similarity index 57% rename from conf.d/dnscrypt.sh rename to conf.d/dnscrypt index a0f3b6a..62ba569 100644 --- a/conf.d/dnscrypt.sh +++ b/conf.d/dnscrypt @@ -7,9 +7,3 @@ resolver_ip='77.66.84.233' resolver_port='443' provider_name='2.dnscrypt-cert.resolver2.dnscrypt.eu' provider_key='3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955' - -service_args="--local-address=${local_ip}:${local_port} \ - --resolver-address=${resolver_ip}:${resolver_port} \ - --provider-name=${provider_name} \ - --provider-key=${provider_key} \ - --user=${local_user}" diff --git a/conf.d/dnscrypt-backup.sh b/conf.d/dnscrypt-backup similarity index 57% rename from conf.d/dnscrypt-backup.sh rename to conf.d/dnscrypt-backup index ddb97e4..27eca16 100644 --- a/conf.d/dnscrypt-backup.sh +++ b/conf.d/dnscrypt-backup @@ -7,9 +7,3 @@ resolver_ip='176.56.237.171' resolver_port='443' provider_name='2.dnscrypt-cert.resolver1.dnscrypt.eu' provider_key='67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66' - -service_args="--local-address=${local_ip}:${local_port} \ - --resolver-address=${resolver_ip}:${resolver_port} \ - --provider-name=${provider_name} \ - --provider-key=${provider_key} \ - --user=${local_user}" diff --git a/conf.d/dropbear b/conf.d/dropbear new file mode 100644 index 0000000..244a282 --- /dev/null +++ b/conf.d/dropbear @@ -0,0 +1,5 @@ +# dropbear config + +cfg_listen_port='2234' + +service_args=( -R -w -F -p "$cfg_listen_port" ) diff --git a/conf.d/dropbear.sh b/conf.d/dropbear.sh deleted file mode 100644 index 10dbd6b..0000000 --- a/conf.d/dropbear.sh +++ /dev/null @@ -1,5 +0,0 @@ -# dropbear config - -cfg_listen_port='2234' - -service_args="-R -w -F -p ${cfg_listen_port}" diff --git a/conf.d/fcgiwrap.sh b/conf.d/fcgiwrap similarity index 55% rename from conf.d/fcgiwrap.sh rename to conf.d/fcgiwrap index 1978a15..a0e0703 100644 --- a/conf.d/fcgiwrap.sh +++ b/conf.d/fcgiwrap @@ -4,5 +4,3 @@ cfg_user='http' cfg_group='http' cfg_socket='/run/fcgiwrap.sock' service_pidfile='/run/fcgiwrap.pid' - -service_args="-s ${cfg_socket} -P ${service_pidfile} -u ${cfg_user} -g ${cfg_group} -- /usr/bin/fcgiwrap" diff --git a/conf.d/kmscon b/conf.d/kmscon new file mode 100644 index 0000000..08e5105 --- /dev/null +++ b/conf.d/kmscon @@ -0,0 +1,4 @@ +# KMSCON config + +kmscon_font_name='terminus' +kmscon_palette='solarized' diff --git a/conf.d/kmscon.sh b/conf.d/kmscon.sh deleted file mode 100644 index 94e81a9..0000000 --- a/conf.d/kmscon.sh +++ /dev/null @@ -1,9 +0,0 @@ -# KMSCON config - -kmscon_font_name='terminus' -kmscon_palette='solarized' - -# The space at the start is important. -service_args+=" --hwaccel --drm \ - --font-name ${kmscon_font_name} \ - --palette ${kmscon_palette}" diff --git a/conf.d/ldm.sh b/conf.d/ldm.sh deleted file mode 100644 index ef2a58b..0000000 --- a/conf.d/ldm.sh +++ /dev/null @@ -1,5 +0,0 @@ -cfg_uid='1000' -cfg_gid='95' -cfg_mountpoint='/media/' - -service_args=( -u "$cfg_uid" -g "$cfg_gid" -p "$cfg_mountpoint" ) diff --git a/conf.d/ngetty b/conf.d/ngetty new file mode 100644 index 0000000..e7a0248 --- /dev/null +++ b/conf.d/ngetty @@ -0,0 +1,2 @@ +# On which ttys to launch ngetty +service_args=( 2 3 ) diff --git a/conf.d/ngetty.sh b/conf.d/ngetty.sh deleted file mode 100644 index 8983895..0000000 --- a/conf.d/ngetty.sh +++ /dev/null @@ -1,3 +0,0 @@ -# dropbear config - -service_args='2 3' diff --git a/init.d/dnscrypt b/init.d/dnscrypt index d31133f..c1f4066 100755 --- a/init.d/dnscrypt +++ b/init.d/dnscrypt @@ -5,3 +5,10 @@ depends dnscrypt-backup #service_respawn='true' service_command='/usr/bin/dnscrypt-proxy' +service_args=( + "--local-address=${local_ip}:${local_port}" + "--resolver-address=${resolver_ip}:${resolver_port}" + "--provider-name=${provider_name}" + "--provider-key=${provider_key}" + "--user=${local_user}" +) diff --git a/init.d/dnscrypt-backup b/init.d/dnscrypt-backup index 90fcf17..62654f4 100755 --- a/init.d/dnscrypt-backup +++ b/init.d/dnscrypt-backup @@ -2,3 +2,10 @@ #service_respawn='true' service_command='/usr/bin/dnscrypt-proxy' +service_args=( + "--local-address=${local_ip}:${local_port}" + "--resolver-address=${resolver_ip}:${resolver_port}" + "--provider-name=${provider_name}" + "--provider-key=${provider_key}" + "--user=${local_user}" +) diff --git a/init.d/dropbear b/init.d/dropbear index 58ffa15..96268a2 100755 --- a/init.d/dropbear +++ b/init.d/dropbear @@ -2,4 +2,3 @@ service_respawn=true service_command='/usr/bin/dropbear' -service_args=( -R -w -F ) diff --git a/init.d/fcgiwrap b/init.d/fcgiwrap index c7db193..484abd5 100755 --- a/init.d/fcgiwrap +++ b/init.d/fcgiwrap @@ -3,3 +3,4 @@ #service_respawn='true' service_command='/usr/bin/spawn-fcgi' +service_args=( -s "$cfg_socket" -P "$service_pidfile" -u "$cfg_user" -g "$cfg_group" -- /usr/bin/fcgiwrap ) diff --git a/init.d/kmscon b/init.d/kmscon index dd0708a..16c73c9 100755 --- a/init.d/kmscon +++ b/init.d/kmscon @@ -1,7 +1,12 @@ #!/usr/bin/env watchman -tty=${service_name##*-}; +tty="${service_name##*-}" service_respawn='true' service_command='/usr/bin/kmscon' -service_args=( --vt "$tty" ) +service_args=( + --vt "$tty" + --hwaccel --drm + --font-name "$kmscon_font_name" + --palette "$kmscon_palette" +) diff --git a/init.d/ldm b/init.d/ldm deleted file mode 100644 index 5187df1..0000000 --- a/init.d/ldm +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env watchman -depends systemd-udevd || return 1 - -#service_respawn='true' -service_command='/usr/bin/ldm'