ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Алексей Сидоров" <alex@reutman.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] кто что планирует поддерживать? мой список
Date: Mon, 26 Mar 2007 23:38:25 +0400
Message-ID: <46082131.2020300@reutman.ru> (raw)
In-Reply-To: <21bd5bb90703261224j67392171r4eb0a6afa7d8404a@mail.gmail.com>

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

Mikhail A. Pokidko пишет:
> 2007/3/26, Алексей Сидоров:
>> Mikhail A. Pokidko пишет:
>>> Могу заделиться отсутствующим в пакете init-script`ом, но он пока не
>>> умеет нормально service pyicq-t stop :-)
>>>
>>>
>> гм. у меня работает скрипт, который всё умеет....
> Обнародуй?
> Мой варинт криво получает pid от "python /usr/bin/pyicqt" и потому не
> может остановить.
> 
> 

Скрипт во вложении.
Его надо подчистить :), но он работает.

-- 
Best regards,	Alexey Sidorov
 	mailto:alex@reutman.ru
	JID: alex@reutman.ru
	ICQ: 5052225

[-- Attachment #2: jabberd2-pyicq --]
[-- Type: text/plain, Size: 2602 bytes --]

#!/bin/sh
#
# jabber-jit	This shell script takes care of starting and stopping
#               jabber-jit standalone Jabber component.
#
# chkconfig: - 71 29
# description: ICQ transport for Jabber  \
#
# processname: jabberd-jit
# config: /etc/jabberd2/jabber-jit.xml
# pidfile: /var/run/jabberd2/jabber-jit.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

JIT_CONF=/etc/jabberd2/pyicq.xml
LOCKFILE=/var/lock/subsys/jabberd2-pyicq
PIDFILE=/var/lib/jabberd2/pid/pyicq.pid
JIT_USER=jabberd2
#JIT_EXEC=/usr/libexec/jabberd2/jabberd-jit
JIT_EXEC=/usr/sbin/pyicq-t
#JIT_DIR=/usr/shlibexec/pyicq-t
OPTIONS="-D --log /var/log/pyicq/pyicq.log"
# Check that networking is up.
[ $NETWORKING = "no" ] && exit 0

RETVAL=0

dstart()
{
#	"$JIT_EXEC" -D -H "$JIT_DIR" -c "$JIT_CONF"
	start_daemon \
	    --lockfile "$LOCKFILE" \
	    --pidfile "$PIDFILE" \
	    --user "$JIT_USER" \
	    --name pyicq-t \
	    --displayname "$JIT_EXEC" \
 	    -- "$JIT_EXEC" -D -c "$JIT_CONF"\
		"$OPTIONS"
	RETVAL=$?
}

start()
{
        # start daemon
#	    --lockfile "$LOCKFILE" \
	start_daemon \
	    --pidfile "$PIDFILE" \
	    --lockfile "$LOCKFILE" \
	    --user "$JIT_USER" \
	    --name pyicq-t \
	    --displayname PyICQ-t \
	    -- "$JIT_EXEC" -b -c "$JIT_CONF" "$OPTIONS"
	RETVAL=$?
}

stop()
{
	stop_daemon \
	    --pidfile "$PIDFILE" \
	    --lockfile "$LOCKFILE" \
	    --expect-user "$JIT_USER" \
	    --displayname PyICQ-t \
	    -- python
	RETVAL=$?
}

stat()
{
	status \
	    --pidfile "$PIDFILE" \
	    --lockfile "$LOCKFILE" \
	    --expect-user "$JIT_USER" \
	    --displayname PyICQ-t \
	    -- python
	RETVAL=$?
}

reload()
{
	# cause the service configuration to be reread, either with kill -HUP:
#	echo -n "Rereading PyICQ-t configuration: "
#	stop_daemon -HUP \
#	    --pidfile "$PIDFILE" \
#	    --expect-user "$JIT_USER" \
#	    --name pyicq \
#	    -- "/usr/bin/python"
	RETVAL=$?
	# or by simple restarting the daemons in a manner similar to restart above.
}

# See how we were called.
case "$1" in
	dstart)
	dstart
		;;
    start)
	start
        ;;
    stop)
	stop
        ;;
    reload)
	reload
	;;
    restart)
	stop
	start
	;;
    condstop)
	# Stop the servce if it is already running, for example:
	if [ -e "$LOCKFILE" ]; then
 	  stop
	fi
	;;
    condrestart)
	# Restart the servce if it is already running, for example:
	if [ -e "$LOCKFILE" ]; then
	  stop
 	  start
	fi
	;;
    status)
      stat
	;;
    *)
	echo "Usage: ${0##*/} {start|stop|reload|restart|condstop|condrestart|status}"
	RETVAL=1

esac

exit $RETVAL

      reply	other threads:[~2007-03-26 19:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-25 20:20 ` Алексей Сидоров
2007-03-26  8:59 ` Mikhail Yakshin
2007-03-26 16:50   ` Денис Смирнов
2007-03-26 18:02     ` Mikhail A. Pokidko
2007-03-26 18:27       ` Алексей Сидоров
2007-03-26 19:24         ` Mikhail A. Pokidko
2007-03-26 19:38           ` Алексей Сидоров [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=46082131.2020300@reutman.ru \
    --to=alex@reutman.ru \
    --cc=devel@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 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