public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] How does OpenRC know if a service is crashed?
@ 2018-08-02  9:32 Alarig Le Lay
  2018-08-02 10:30 ` Manuel Mommertz
  0 siblings, 1 reply; 3+ messages in thread
From: Alarig Le Lay @ 2018-08-02  9:32 UTC (permalink / raw
  To: gentoo-user

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-02 12:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-02  9:32 [gentoo-user] How does OpenRC know if a service is crashed? Alarig Le Lay
2018-08-02 10:30 ` Manuel Mommertz
2018-08-02 12:05   ` Alarig Le Lay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox