ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Vyacheslav Brunev <bv@gres.tomske.elektra.ru>
To: ALT Linux Community general discussions <community@lists.altlinux.org>
Subject: [Comm] старт-script и процесс.pid
Date: Thu, 10 Apr 2008 16:34:48 +0700
Message-ID: <200804101634.48739.bv@gres.tomske.elektra.ru> (raw)

Здравствуйте уважаемые подписчики!

В который раз вынужден просить у Вас помощи в доселе не виданном проблемном 
вопросе. Проблема состоит в следующем - в директории /etc/init.d/ есть скрипт 
назовём его 'progr', со следующим участком кода (для запуска программы):

PIDFILE=/var/run/prog.pid
LOCKFILE=/var/lock/subsys/progr
RETVAL=0

start()
{
        is_yes "$NETWORKING" || return 0
       start_daemon --make-pidfile --pidfile "$PIDFILE" --lockfile "$LOCKFILE" 		
\--expect-user root -- /usr/sbin/progr
        RETVAL=$?
        return $RETVAL
}

Всё работает и запускается, НО после запуска программе присваивается PID ровно 
на единицу больше чем записывается в /var/run/progr.pid. Соответственно 
корректно выключить её я уже не могу т.к. для останова (см. ниже) скрипт 
смотрит в /var/run/, а там номер на единицу меньше. В ответ на введённую 
команду: service progr stop 
следует примерно такой ответ - программа не запущена, не отвлекайте по 
пустякам от работы :(

Участок кода для остановки программы:

stop()
{
        stop_daemon --lockfile "$LOCKFILE" \
--expect-user root /usr/sbin/progr --pidfile "$PIDFILE"
        RETVAL=$?
        return "$RETVAL"
}

Подскажите, что может быть не так?

-- 
С уважением, Вячеслав.

             reply	other threads:[~2008-04-10  9:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10  9:34 Vyacheslav Brunev [this message]
2008-04-10 10:46 ` Pavlov Konstantin
2008-04-11  1:56   ` Vyacheslav Brunev
2008-04-11  9:27     ` Dmitry V. Levin

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=200804101634.48739.bv@gres.tomske.elektra.ru \
    --to=bv@gres.tomske.elektra.ru \
    --cc=community@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 Community general discussions

This inbox may be cloned and mirrored by anyone:

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

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


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