From: Vyacheslav Brunev <bv@gres.tomske.elektra.ru>
To: ALT Linux Community general discussions <community@lists.altlinux.org>
Subject: Re: [Comm] старт-script и процесс.pid
Date: Fri, 11 Apr 2008 08:56:39 +0700
Message-ID: <200804110856.39737.bv@gres.tomske.elektra.ru> (raw)
In-Reply-To: <20080410104620.GK2775@cryo.net.ru>
В сообщении от Thursday 10 April 2008 17:46:20 Pavlov Konstantin написал(а):
> On Thu, Apr 10, 2008 at 04:34:48PM +0700, Vyacheslav Brunev wrote:
> > Здравствуйте уважаемые подписчики!
> >
> > В который раз вынужден просить у Вас помощи в доселе не виданном
> > проблемном вопросе. Проблема состоит в следующем - в директории
> > /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/, а там номер на единицу меньше.
>
> Видимо, программа сама создает pid-файл. Уберите --make-pidfile из
> start_daemon.
Спасибо за совет. Я тоже опытным путём пришёл к такому рабочему варианту.
Если убрать эту инструкцию, соответственно вообще не
создаётся /var/run/vsftpd.pid, поэтому и выкидываю вообще из скрипта
строчки --pidfile "$PIDFILE" и как ни странно всё начинает корректно
работать. Правда хотелось иметь pid-файл с номером процесса...
Странно ещё то, что для других программ (если добавить такие-же инструкции),
то скрипт работает корректно, а тут....шайтан :(
--
С уважением, Вячеслав.
next prev parent reply other threads:[~2008-04-11 1:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 9:34 Vyacheslav Brunev
2008-04-10 10:46 ` Pavlov Konstantin
2008-04-11 1:56 ` Vyacheslav Brunev [this message]
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=200804110856.39737.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