ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Alexey Morsov <samurai@ricom.ru>
To: community@altlinux.ru
Subject: Re: [COMM] кошерный запуск процесса
Date: Tue, 15 Feb 2005 16:13:13 +0300
Message-ID: <4211F569.6050406@ricom.ru> (raw)
In-Reply-To: <7F656893B4EBB84BA46DB77DB894399C69CAE7@kmex3.kvazar-micro.com>

И снова про коШшшерный запуск процесса %-)
кто-нибудь может объяснить почему имея

[root@test init.d]# cat mailsender
#!/bin/sh
#
# mailsender    start and stop mailsender process
#
# chkconfig: 345 90 10
#
# description:  mailsender is to send alerts via email
#
# processname: mailsender
# pidfile: /var/run/mailsender.pid
#
# Source function library.
. /etc/init.d/functions

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

start() {
#    is_yes "$NETWORKING" || return 0
      start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE"
--expect-user webmaster -- mailsender -d
      RETVAL=$?
      return $RETVAL
}

stop() {
      stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE"
--expect-user webmaster mailsender
      RETVAL=$?
      return $RETVAL
}

restart() {
      stop
      start
}

case "$1" in
          start)
          start
          ;;
          stop)
          stop
          ;;
     restart)
          restart
          ;;
     status)
          status --pidfile "$PIDFILE" --expect-user webmaster mailsender
          RETVAL=$?
          ;;
     *)
          msg_usage "${0##*/} {start|stop|restart|status}"
          RETVAL=1
esac

exit $RETVAL

(фактически скопировал с cyrus-imapd)

далее, имеем следующее безобразие:

[root@test init.d]# service mailsender status
mailsender is stopped
[root@test init.d]# service mailsender start
Starting mailsender service:
                                                [ DONE ]
[root@test init.d]# ps aux|grep mailsender
root      7867  0.0  0.2  2056  540 pts/0    S    14:15   0:00
/usr/local/bin/mailsender -d
[root@test init.d]# service mailsender status
mailsender is dead, but subsystem is locked
[root@test init.d]# ps aux|grep mailsender
root      7867  0.0  0.3  2104  776 pts/0    S    14:15   0:00
/usr/local/bin/mailsender -d
[root@test init.d]# service mailsender stop
Service mailsender is not running.
                                                [PASSED]
[root@test init.d]# ps aux|grep mailsender
root      7867  0.0  0.3  2104  776 pts/0    S    14:15   0:00
/usr/local/bin/mailsender -d
[root@test init.d]# ls -l /var/run/|grep mail
drwxrwxr-x  2 root      mail     4096 Feb 14 17:39 amavis
drwxrwsr-t  2 root      mail     4096 Feb 14 17:39 clamav
drwxr-x--x  2 mailgraph root     4096 Feb 14 17:39 mailgraph
[root@test init.d]# ls -l /var/lock/subsys/|grep mail
[root@test init.d]# kill 7867
[root@test init.d]# ps aux|grep mailsender

:(

-- 
Всего наилучшего,
Системный Администратор ЗАО "ИК "РИКОМ-ТРАСТ"
Алексей Морсов
ICQ: 196766290
Jabber: Samurai@jabber.pibhe.com
http://www.ricom.ru
http://www.fondmarket.ru


  parent reply	other threads:[~2005-02-15 13:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-10 12:10 Eugene.Ostapets
2005-02-10 12:42 ` Alexey Morsov
2005-02-10 13:10   ` Alexey V. Novikov
2005-02-11  9:55   ` Grigory Milev
2005-02-11 10:12     ` Alexey Morsov
2005-02-11 10:36       ` Grigory Milev
2005-02-11 11:20         ` Alexey Morsov
2005-02-11 11:33           ` Andriy Dobrovol's'kii
2005-02-11 11:40             ` Alexey Morsov
2005-02-11 12:05           ` Grigory Milev
2005-02-11 14:12             ` Alexey Morsov
2005-02-14  8:17 ` Alexey Morsov
2005-02-14 11:32 ` Eugene Prokopiev
2005-02-15 13:13 ` Alexey Morsov [this message]
2005-02-15 13:34   ` [COMM][JT] " Vasya Makarov
2005-02-15 14:46     ` Alexey Morsov

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=4211F569.6050406@ricom.ru \
    --to=samurai@ricom.ru \
    --cc=community@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 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