소스 검색

feat(ldap): Start and configure only if enabled.

damencho 7 달 전
부모
커밋
1db83ed
2개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      prosody/rootfs/etc/cont-init.d/10-config
  2. 7 1
      prosody/rootfs/etc/services.d/10-saslauthd/run

+ 1 - 1
prosody/rootfs/etc/cont-init.d/10-config

@@ -1,6 +1,6 @@
 #!/usr/bin/with-contenv bash
 
-if [[ ! -f /etc/saslauthd.conf ]]; then
+if [[ ! -f /etc/saslauthd.conf ]] && [[ "$AUTH_TYPE" == "ldap" ]]; then
   tpl /defaults/saslauthd.conf > /etc/saslauthd.conf
   mkdir -pm777 /var/run/saslauthd
   adduser prosody sasl

+ 7 - 1
prosody/rootfs/etc/services.d/10-saslauthd/run

@@ -1,2 +1,8 @@
 #!/usr/bin/with-contenv bash
-exec s6-setuidgid root saslauthd -a ldap -O /etc/saslauthd.conf -c -m /var/run/saslauthd -n 5 -d
+if [[ -f /etc/saslauthd.conf ]]; then
+  exec s6-setuidgid root saslauthd -a ldap -O /etc/saslauthd.conf -c -m /var/run/saslauthd -n 5 -d
+else
+    # if saslauthd should not be started,
+    # prevent s6 from restarting this script again and again
+    s6-svc -O /var/run/s6/services/10-saslauthd
+fi