Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
igmpproxy 0.2.1 don't creates pid
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
anaksimandr
n00b
n00b


Joined: 04 Mar 2010
Posts: 10

PostPosted: Mon Oct 08, 2018 8:01 pm    Post subject: igmpproxy 0.2.1 don't creates pid Reply with quote

Hello.
I have a problem with running igmpproxy as daemon.
If run igmpproxy -v -d -n /etc/igmpproxy.conf everything looks norm (without pid ofc).
When I execute /etc/init.d/igmpproxy start, it starts and works to, but the pidfile does not creates.
Why? And how solve this problem?
It became so after update to 0.2.1.

In init script pidfile set like pidfile="/run/${RC_SVCNAME}.pid"
but there is nothing in /run like igmpproxy.pid
Code:
# ls /run
agetty.reload      hostapd      mysqld     openldap            php-fpm.socket  sudo           teaserver
crond.pid          hostapd.pid  named      openrc              proftpd         svnserve.pid   udev
dhcpcd             lock         nginx.pid  php-fpm             samba           syslog-ng.ctl  utmp
dhcpcd-enp1s0.pid  mount        ntpd.pid   php-fpm-php7.1.pid  sshd.pid        syslog-ng.pid  xtables.lock

Code:
# ps -A | grep igm
 8596 ?        00:00:00 igmpproxy

command /etc/init.d/igmpproxy start -d shows this
Code:
 * Starting igmpproxy ... [ ok ]
+ sourcex -e /etc/rc.conf
+ '[' -e = -e ']'
+ shift
+ '[' -e /etc/rc.conf ']'
+ . /etc/rc.conf
++ rc_shell=/sbin/sulogin
++ unicode=YES
++ rc_tty_number=12
+ '[' -d /etc/rc.conf.d ']'
+ _conf_d=/etc/init.d/../conf.d
+ _c=igmpproxy
+ '[' -n igmpproxy -a igmpproxy '!=' igmpproxy ']'
+ unset _c
+ sourcex -e /etc/init.d/../conf.d/igmpproxy.default
+ '[' -e = -e ']'
+ shift
+ '[' -e /etc/init.d/../conf.d/igmpproxy.default ']'
+ return 1
+ sourcex -e /etc/init.d/../conf.d/igmpproxy
+ '[' -e = -e ']'
+ shift
+ '[' -e /etc/init.d/../conf.d/igmpproxy ']'
+ . /etc/init.d/../conf.d/igmpproxy
++ IGMPPROXY_OPTS=
+ unset _conf_d
+ sourcex /lib/rc/sh/runit.sh
+ '[' /lib/rc/sh/runit.sh = -e ']'
+ . /lib/rc/sh/runit.sh
+ sourcex /lib/rc/sh/s6.sh
+ '[' /lib/rc/sh/s6.sh = -e ']'
+ . /lib/rc/sh/s6.sh
++ '[' -z '' ']'
++ s6_service_path=/var/svc.d/igmpproxy
+ sourcex /lib/rc/sh/start-stop-daemon.sh
+ '[' /lib/rc/sh/start-stop-daemon.sh = -e ']'
+ . /lib/rc/sh/start-stop-daemon.sh
+ sourcex /lib/rc/sh/supervise-daemon.sh
+ '[' /lib/rc/sh/supervise-daemon.sh = -e ']'
+ . /lib/rc/sh/supervise-daemon.sh
+ sourcex /etc/init.d/igmpproxy
+ '[' /etc/init.d/igmpproxy = -e ']'
+ . /etc/init.d/igmpproxy
++ config=/etc/igmpproxy.conf
++ name=igmpproxy
++ pidfile=/run/igmpproxy.pid
++ command=igmpproxy
++ command_args=' /etc/igmpproxy.conf'
++ procname=igmpproxy
+ yesno ''
+ '[' -z '' ']'
+ return 1
+ for _cmd in "$@"
+ '[' start '!=' status -a start '!=' describe ']'
+ '[' -n '' ']'
++ command -v cgroup_add_service
+ '[' cgroup_add_service = cgroup_add_service ']'
+ grep -qs /sys/fs/cgroup /proc/1/mountinfo
+ '[' -d /sys/fs/cgroup -a '!' -w /sys/fs/cgroup ']'
+ cgroup_add_service
+ for d in /sys/fs/cgroup/*
+ '[' -w /sys/fs/cgroup/cpu/tasks ']'
+ printf %d 0
+ for d in /sys/fs/cgroup/*
+ '[' -w /sys/fs/cgroup/cpuacct/tasks ']'
+ printf %d 0
+ for d in /sys/fs/cgroup/*
+ '[' -w /sys/fs/cgroup/cpuset/tasks ']'
+ printf %d 0
+ for d in /sys/fs/cgroup/*
+ '[' -w /sys/fs/cgroup/freezer/tasks ']'
+ printf %d 0
+ for d in /sys/fs/cgroup/*
+ '[' -w /sys/fs/cgroup/openrc/tasks ']'
+ printf %d 0
+ for d in /sys/fs/cgroup/*
+ '[' -w /sys/fs/cgroup/unified/tasks ']'
+ openrc_cgroup=/sys/fs/cgroup/openrc
+ '[' -d /sys/fs/cgroup/openrc ']'
+ cgroup=/sys/fs/cgroup/openrc/igmpproxy
+ mkdir -p /sys/fs/cgroup/openrc/igmpproxy
+ '[' -w /sys/fs/cgroup/openrc/igmpproxy/tasks ']'
+ printf %d 0
++ command -v cgroup_set_limits
+ '[' cgroup_set_limits = cgroup_set_limits ']'
+ cgroup_set_limits
+ local blkio=
+ '[' -n '' ']'
+ local cpu=
+ '[' -n '' ']'
+ local cpuacct=
+ '[' -n '' ']'
+ local cpuset=
+ '[' -n '' ']'
+ local devices=
+ '[' -n '' ']'
+ local hugetlb=
+ '[' -n '' ']'
+ local memory=
+ '[' -n '' ']'
+ local net_cls=
+ '[' -n '' ']'
+ local net_prio=
+ '[' -n '' ']'
+ local pids=
+ '[' -n '' ']'
+ return 0
++ command -v cgroup2_set_limits
+ '[' cgroup2_set_limits = cgroup2_set_limits ']'
+ '[' start = start ']'
+ cgroup2_set_limits
+ local cgroup_path
++ cgroup2_find_path
++ grep -qw cgroup2 /proc/filesystems
++ case "${rc_cgroup_mode:-hybrid}" in
++ printf /sys/fs/cgroup/unified
++ return 0
+ cgroup_path=/sys/fs/cgroup/unified
+ '[' -d /sys/fs/cgroup/unified ']'
+ rc_cgroup_path=/sys/fs/cgroup/unified/igmpproxy
+ '[' '!' -d /sys/fs/cgroup/unified/igmpproxy ']'
+ mkdir /sys/fs/cgroup/unified/igmpproxy
+ '[' -f /sys/fs/cgroup/unified/igmpproxy/cgroup.procs ']'
+ printf 0
+ '[' -z '' ']'
+ return 0
+ break
+ eval 'printf '\''%s\n'\'' '
++ printf '%s\n'
+ read _d
+ '[' -n '' ']'
+ read _d
+ '[' 0 -ne 0 ']'
+ unset _d
+ eval 'printf '\''%s\n'\'' '
++ printf '%s\n'
+ read _f
+ '[' -n '' ']'
+ read _f
+ '[' 0 -ne 0 ']'
+ unset _f
+ '[' -n '' ']'
+ '[' -n start ']'
+ '[' start = depend ']'
+ for _cmd in describe start stop status ${extra_commands:-$opts} $extra_started_commands $extra_stopped_commands
+ '[' describe = start ']'
+ for _cmd in describe start stop status ${extra_commands:-$opts} $extra_started_commands $extra_stopped_commands
+ '[' start = start ']'
++ command -v start
+ '[' start = start ']'
+ yesno
+ '[' -z '' ']'
+ return 1
+ for _cmd in $extra_stopped_commands
+ '[' cgroup_cleanup = start ']'
+ unset _cmd
+ case $1 in
+ verify_boot
+ '[' '!' -e /run/openrc/softlevel ']'
+ return 0
++ command -v start_pre
+ '[' start_pre = start_pre ']'
+ start_pre
+ '[' '!' -f /etc/igmpproxy.conf ']'
+ return 0
+ start
+ default_start
+ local func=ssd_start
+ case "$supervisor" in
+ ssd_start
+ '[' -z igmpproxy ']'
+ local _background=
+ ebegin 'Starting igmpproxy'
+ local _r
+ command ebegin 'Starting igmpproxy'
+ ebegin 'Starting igmpproxy'
 * Starting igmpproxy ...+ _r=0
+ EINFO_LASTCMD=ebegin
+ export EINFO_LASTCMD
+ return 0
+ yesno ''
+ '[' -z '' ']'
+ return 1
+ yesno ''
+ '[' -z '' ']'
+ return 1
+ '[' -n '' ']'
+ '[' -n '' ']'
+ eval start-stop-daemon --start --exec igmpproxy --name igmpproxy --pidfile /run/igmpproxy.pid -- /etc/igmpproxy.conf
++ start-stop-daemon --start --exec igmpproxy --name igmpproxy --pidfile /run/igmpproxy.pid -- /etc/igmpproxy.conf
+ eend 0 'Failed to start igmpproxy'
+ local _r
+ command eend 0 'Failed to start igmpproxy'
+ eend 0 'Failed to start igmpproxy'
 [ ok ]
+ _r=0
+ EINFO_LASTCMD=eend
+ export EINFO_LASTCMD
+ return 0
+ service_set_value command igmpproxy
+ '[' -n '' ']'
+ '[' -n /run/igmpproxy.pid ']'
+ service_set_value pidfile /run/igmpproxy.pid
+ '[' -n igmpproxy ']'
+ service_set_value procname igmpproxy
+ return 0
++ command -v start_post
+ '[' '' = start_post ']'
++ command -v cgroup_cleanup
+ '[' cgroup_cleanup = cgroup_cleanup ']'
+ '[' start = stop ']'
++ command -v cgroup2_remove
+ '[' cgroup2_remove = cgroup2_remove ']'
+ '[' start = stop ']'
+ '[' -z igmpproxy ']'
+ shift
+ continue 2
+ '[' -n '' ']'
+ exit 0
Back to top
View user's profile Send private message
SkyBeam
n00b
n00b


Joined: 27 Nov 2006
Posts: 7
Location: Switzerland

PostPosted: Tue Dec 18, 2018 12:29 pm    Post subject: Re: igmpproxy 0.2.1 don't creates pid Reply with quote

anaksimandr wrote:
Hello.
In init script pidfile set like pidfile="/run/${RC_SVCNAME}.pid"
but there is nothing in /run like igmpproxy.pid


I think this is the culprit. As written here we should use procname instead of pidfile if the process backgrounds itself but does not write a PID file:

Quote:

If the daemon backgrounds itself and does not create a PID file, use procname instead of pidfile. But, if your daemon has the option to run in the foreground, then you should do that instead (that would be the case in the previous item).


I think openrc is looking for the process name (procname) in the process table if no PID file can be found. But if the pidfile variable exists it will look for it and igmpproxy does not seem to write one. Actually the PID file is not needed so I even prefer not using one.

The solution is simply to comment the pidfile line in /etc/init.d/igmpproxy:
Code:

#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

config="/etc/${RC_SVCNAME}.conf"
name="IGMPproxy"
# pidfile="/run/${RC_SVCNAME}.pid"

command="igmpproxy"
command_args="${IGMPPROXY_OPTS} ${config}"
procname="${RC_SVCNAME}"

start_pre() {
        if [ ! -f "${config}" ]; then
                eerror "Please create ${config} before starting ${name}!"
                return 1
        else
                return 0
        fi
}


Works just fine for me.
_________________
SkyBeam :: the sky isn't the limit
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum