Opened 2 years ago

Last modified 2 years ago

#4628 new enhancement

Pidfile shows CHILD process id and not MAIN process id in background mode

Reported by: prilly Owned by:
Priority: major Component: General
Severity: medium Keywords: Pidfile systemd
Cc: Sensitive: no

Description

The PIDFile= setting un systemds unit file is a setting that tells
systemd where to look for PID files that it reads in to find
out the main PID of a forking process.

OScam creates a pidfile with process id, when running oscam with background flag the process seems to be forking a child.

OScams pidfile is listing the childe process, (the forked process). When levering the use of systemd this creats problems with systemd monitoring of the process, as the pidfile should contain the MAIN process id and not the CHILD process.

is it possible to fix this so the pidfile is showing the MAIN process id and not the child process when running it in background mode.

Change History (1)

comment:1 Changed 2 years ago by prilly

[Unit]
Description=OScam
After=network.target
Requires=network.target

[Service]
Type=forking
PIDFile=/var/run/oscam.pid
ExecStart?=/usr/local/bin/oscam -b -B /var/run/oscam.pid
ExecStop?=/bin/rm /var/run/oscam.pid
TimeoutStopSec?=1
Restart=always
RestartSec?=5
StartLimitInterval?=0

[Install]
WantedBy?=multi-user.target

Note: See TracTickets for help on using tickets.