ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Ivan A. Melnikov" <iv@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Cc: omg@altlinux.org, sin@altlinux.ru, gkot@altlinux.org
Subject: Re: [devel] Обновление до Samba-4.7 (проблема с tty-ask-password-agent)
Date: Mon, 26 Mar 2018 17:09:49 +0400
Message-ID: <CANR-VvwuReCWeN9Oc6E-L9O6E4uKp=1xfpsG11VOE3DGy79TRw@mail.gmail.com> (raw)
In-Reply-To: <CAK42-Goseb8312jhJmegQfR6=xXV_xv02EqyYOTCZt_gT2KVRQ@mail.gmail.com>

> В общем, проблему удалось локализовать. К такому странному эффекту у
> нас приводит опция --foreground, которая прописана в новых
> service-файлах.

Там забавно: в сервис-файле там написно "Type=notify", но sd_notify(3) samba
вызывает только когда она стартует как демон; естественно, с --forground
она себя демоном не считает:

http://git.altlinux.org/people/sin/packages/samba.git?p=samba.git;a=blob;f=source4/smbd/server.c;h=60e2797eb74941ba570a9c2cd55a56ffad9b5ef3;hb=HEAD#l430

> Причина фантомного запуска systemd-tty-ask-password-agent,
> предположительно, связана с дефолтным поведением systemd, при наличии
> открытых файловых дескрипторов

systemd-tty-ask-password-agent тут похоже вообще не при чём, он там всегда
светится.

> Планирую убрать опцию --foreground, а --no-process-group оставить.

Разумно.


2018-03-26 16:25 GMT+04:00 Evgeny Sinelnikov <sin@altlinux.org>:
> Здравствуйте,
>
> В общем, проблему удалось локализовать. К такому странному эффекту у
> нас приводит опция --foreground, которая прописана в новых
> service-файлах.
>
> commit e90e3d7efb555dc430ba47c433c96f4f4835f33f
> Author: Andreas Schneider <asn@samba.org>
> Date:   Fri Nov 10 09:32:27 2017 +0100
>
>     systemd: Start processes in forground and without a process group
>
>     We should not double fork in notify mode or systemd think something
>     during startup will be wrong and send SIGTERM to the process. So
>     sometimes the daemon will not start up correctly.
>
>     systemd will also handle the process group.
>
>     BUG: https://bugzilla.samba.org/show_bug.cgi?id=13129
>
>     Signed-off-by: Andreas Schneider <asn@samba.org>
>     Reviewed-by: Andrew Bartlett <abartlet@samba.org>
>
>     (cherry picked from commit 8b6f58194da7e849cdb9d20712dff49b17a93a77)
>
> diff --git a/packaging/systemd/samba.service b/packaging/systemd/samba.service
> index 824f89c..1b64c3b 100644
> --- a/packaging/systemd/samba.service
> +++ b/packaging/systemd/samba.service
> @@ -8,7 +8,7 @@ NotifyAccess=all
>  PIDFile=/run/samba.pid
>  LimitNOFILE=16384
>  EnvironmentFile=-/etc/sysconfig/samba
> -ExecStart=/usr/sbin/samba $SAMBAOPTIONS
> +ExecStart=/usr/sbin/samba --foreground --no-process-group $SAMBAOPTIONS
>  ExecReload=/usr/bin/kill -HUP $MAINPID
>
>  [Install]
>
> Причина фантомного запуска systemd-tty-ask-password-agent,
> предположительно, связана с дефолтным поведением systemd, при наличии
> открытых файловых дескрипторов (тут нужно внимательнее посмотреть на
> поведение опции --foreground, такое поведение должно быть только с
> опцией --interactive).
>
> Планирую убрать опцию --foreground, а --no-process-group оставить.
>
>
>
> 26 марта 2018 г., 1:51 пользователь Evgeny Sinelnikov
> <sin@altlinux.org> написал:
>> Здравствуйте,
>>
>> я подготовил сборку samba-4.7.6:
>> #201848 TESTED #3 [test-only] sisyphus libtalloc.git=2.1.12-alt1%ubt
>> libtdb.git=1.3.15-alt1%ubt libtevent.git=0.9.36-alt1%ubt
>> libldb.git=1.3.2-alt1%ubt samba.git=4.7.6-alt1%ubt
>> samba-DC.git=dc/4.7.6-alt1%ubt openchange.git=2.4-alt23.zentyal23%ubt
>> sssd.git=1.16.1-alt2%ubt freeipa.git=4.6.3-alt4%ubt
>>
>> но столкнулся со странной проблемой при обновлении (на текущей
>> samba-4.6.14 я такой проблемы не наблюдаю) - при старте samba (которая
>> успешно запускается) через systemctl процесс systemd где-то подвисает:
>> root      1329  0.0  0.3  49048  5164 ?        Ss   00:09   0:00
>> /usr/sbin/sshd -D
>> root     16841  0.0  0.4  85592  6236 ?        Ss   00:24   0:00  \_
>> sshd: vagrant [priv]
>> vagrant  16845  0.1  0.3  85592  4820 ?        S    00:24   0:00  |
>> \_ sshd: vagrant@pts/0
>> vagrant  16846  0.1  0.3  19464  5476 pts/0    Ss   00:24   0:00  |
>>    \_ -bash
>> root     16956  0.0  0.2  49224  3644 pts/0    S+   00:26   0:00  |
>>        \_ sudo apt-get dist-upgrade
>> root     16957 16.8 10.5 213056 156756 pts/0   S+   00:26   0:03  |
>>            \_ apt-get dist-upgrade
>> root     16980  0.0  0.1   8464  2524 pts/0    S+   00:26   0:00  |
>>                \_ /bin/sh /tmp/.private/root/rpm-tmp.4NuIOg 2
>> root     16981  0.0  0.1   8464  2408 pts/0    S+   00:26   0:00  |
>>                    \_ /bin/sh /usr/sbin/post_service samba
>> root     16997  0.0  0.3  66800  5632 pts/0    S+   00:26   0:00  |
>>                        \_ systemctl try-restart samba.service
>>
>> При повторном рестарте вручную видно следующую картину:
>> root      1329  0.0  0.3  49048  5164 ?        Ss   00:09   0:00
>> /usr/sbin/sshd -D
>> root     16841  0.0  0.4  85592  6236 ?        Ss   00:24   0:00  \_
>> sshd: vagrant [priv]
>> vagrant  16845  0.0  0.3  85592  4820 ?        S    00:24   0:00  |
>> \_ sshd: vagrant@pts/0
>> vagrant  16846  0.0  0.3  19464  5476 pts/0    Ss   00:24   0:00  |
>>    \_ -bash
>> root     18160  0.0  0.2  49224  3668 pts/0    S+   00:34   0:00  |
>>        \_ sudo systemctl restart samba
>> root     18161  0.0  0.3  66800  5612 pts/0    S+   00:34   0:00  |
>>            \_ systemctl restart samba
>> root     18162  0.0  0.2  65044  3156 pts/0    S+   00:34   0:00  |
>>                \_ /sbin/systemd-tty-ask-password-agent --watch
>>
>> Ошибка эта воспроизводится в различных конфигурациях и дистрибутивах:
>> - https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1456789
>> - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774153
>> - https://github.com/NixOS/nixpkgs/issues/2584
>>
>> У нас что-то подобное тоже проявляется:
>> https://bugzilla.altlinux.org/show_bug.cgi?id=34298
>>
>> Очевидно тут ещё вот что - проблема проявляется только в новой версии.
>> А значит в ней есть какая-то важная особенность. В чём она состоит я
>> пока не разобрался.
>>
>>
>> PS: Есть по сборке несколько моментов, которые нужно учесть, но сейчас
>> речь не о них:
>> - версии libtevent-0.9.36 и ldb-1.3.2 (стоит ли её использовать вместо
>> ldb-1.2.3? С ходу я ничего крамольного по ABI не встретил и решил
>> потестировать);
>> - сборку с нативным Kerberos я отложил до следующего релиза alt2,
>> чтобы ловить регрессии по частям.
>>
>> --
>> Sin (Sinelnikov Evgeny)
>
>
>
> --
> Sin (Sinelnikov Evgeny)
> _______________________________________________
> Devel mailing list
> Devel@lists.altlinux.org
> https://lists.altlinux.org/mailman/listinfo/devel



-- 
WBR,
Ivan A. Melnikov

      reply	other threads:[~2018-03-26 13:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-25 21:51 Evgeny Sinelnikov
2018-03-26 12:25 ` Evgeny Sinelnikov
2018-03-26 13:09   ` Ivan A. Melnikov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANR-VvwuReCWeN9Oc6E-L9O6E4uKp=1xfpsG11VOE3DGy79TRw@mail.gmail.com' \
    --to=iv@altlinux.org \
    --cc=devel@lists.altlinux.org \
    --cc=gkot@altlinux.org \
    --cc=omg@altlinux.org \
    --cc=sin@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git