ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Linux Sisyphus mailing list <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] не отрабатывает нормально start-stop-deamon (имя процесса содержит пробелы)
Date: Wed, 7 May 2014 20:47:38 +0400
Message-ID: <20140507164738.GA5136@altlinux.org> (raw)
In-Reply-To: <CAFE-3XbhRVxa-ZS1bu+9_Srfn_bmbOYZhbqw33iyMiwq73_tyA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2006 bytes --]

On Wed, May 07, 2014 at 11:00:41PM +0700, Denis G. Samsonenko wrote:
> День добрый!
> 
> Разбираясь с ddclient обнаружил, что не отрабатывает останов сервиса.
> Процесс продолжает работать после останова. Соответственно повторный
> запуск запускает ещё один процесс. То же самое происходит при рестарте
> сервиса.
> 
> Покопавшись в /rc.d/init.d/ddclientd и /rc.d/init.d/functions понял,
> что start-stop-daemon не находит процесс ddclient.
> 
> $ ps ax |grep ddclient
> 8562 ?        S      0:00 ddclient - sleeping for 30 seconds
> 
> $ cat /proc/8562/cmdline
> ddclient - sleeping for 30 seconds
> 
> $ cat /proc/8562/stat
> 8562 (ddclient - slee) S 1 8481 8481 0 -1 1077944384 999 3150 0 0 2 0
> 0 1 20 0 1 0 5329363 30277632 1811 18446744073709551615 4194304
> 4198956 140736794566528 140736794565432 140013415770624 0 0 128 16385
> 18446744071579414165 0 0 17 2 0 0 0 0 0 6299072 6299804 6303744
> 140736794570065 140736794570112 140736794570112 140736794570725 0
> 
> На сколько я понял, start-stop-daemon сверяет заданное имя процесса с
> тем, что находит в /proc/[pid]/stat, а там оно оказывается таким:
> "ddclient - slee".
> 
> Ручной запуск start-stop-daemon с параметром --name "ddclient - slee"
> отрабатывает нормально:
> 
> # start-stop-daemon --stop --test --name "ddclient - slee" --pidfile
> /var/run/ddclient/ddclient.pid
> Would send signal 15 to 8562.
> 
> 
> Если же запустить с --name ddclient, то отработает с ошибкой:
> 
> # start-stop-daemon --stop --test --name ddclient --pidfile
> /var/run/ddclient/ddclient.pid
> No ddclient found running; none killed.
> 
> 
> Попытка подсунуть --name "ddclient - slee" в /rc.d/init.d/ddclientd не
> приводит к успеху. По видимому где-то по дороге к вызову
> start-stop-daemon теряются кавычки. Пытался по всякому их вкладывать и
> экранировать -- не помогло.
> 
> Можно как-нибудь с этим справиться?

Не используйте --name, идентификация по /proc/<pid>/exe гораздо надежнее.


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2014-05-07 16:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 16:00 Denis G. Samsonenko
2014-05-07 16:47 ` Dmitry V. Levin [this message]
2014-05-07 20:35   ` Alexei V. Mezin
2014-05-07 21:10     ` Michael Shigorin
2014-05-07 21:29       ` Alexei V. Mezin
2014-05-07 21:44         ` Dmitry V. Levin
2014-05-08 12:19           ` Denis G. Samsonenko
2014-05-08 12:47             ` Denis G. Samsonenko
2014-05-08 12:53               ` Denis G. Samsonenko
2014-05-09 18:17                 ` Michael Shigorin
2014-05-09 18:41                   ` Paul Wolneykien
2014-05-12 10:24                     ` Rinat Bikov
2014-05-08 12:50             ` Alexei V. Mezin
2014-05-08 12:55               ` Denis G. Samsonenko

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=20140507164738.GA5136@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=sisyphus@lists.altlinux.org \
    /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 Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/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 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

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


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