From: Alarig Le Lay <alarig@swordarmor.fr>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] How does OpenRC know if a service is crashed?
Date: Thu, 2 Aug 2018 11:32:23 +0200 [thread overview]
Message-ID: <20180802093223.3bjnp57czg7l2tf7@mew.swordarmor.fr> (raw)
Hi,
Some times ago, I wrote a basic init script for a service I’m running
but that is not in the tree.
It’s just a python script behind a reverse-proxy.
bulbizarre ~ # cat /etc/init.d/paste-py
#!/sbin/openrc-run
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#depend() {
#
#}
start() {
start-stop-daemon --start --user pastepy --exec paste-py.sh --name paste-py
eend $?
}
stop() {
kill $(cat /opt/paste-py/paste.pid)
}
bulbizarre ~ # cat $(which paste-py.sh)
#!/bin/sh
port="$(grep port /opt/paste-py/paste-py.conf | cut -d '=' -f 2)"
addr="$(grep addr /opt/paste-py/paste-py.conf | cut -d '=' -f 2)"
cd /opt/paste-py
source bin/activate
./daemonize.py --port=${port} --addr=${addr}
bulbizarre ~ # cat /opt/paste-py/paste.pid
9480
bulbizarre ~ # ps aux | grep 9480
root 493 0.0 0.0 11440 924 pts/3 S+ 11:14 0:00 grep --colour=auto 9480
pastepy 9480 0.0 0.4 113548 16848 ? S 08:05 0:00 python ./daemonize.py --port=8087 --addr=127.0.0.1
So, the process is running (and responding), but OpenRC shows it as
crashed
bulbizarre ~ # rc-status | grep crash
paste-py [ crashed ]
What do I have to change?
Thanks,
--
alarig
next reply other threads:[~2018-08-02 9:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 9:32 Alarig Le Lay [this message]
2018-08-02 10:30 ` [gentoo-user] How does OpenRC know if a service is crashed? Manuel Mommertz
2018-08-02 12:05 ` Alarig Le Lay
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=20180802093223.3bjnp57czg7l2tf7@mew.swordarmor.fr \
--to=alarig@swordarmor.fr \
--cc=gentoo-user@lists.gentoo.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox