Bug 63440 - RFE: better use of functions in /etc/rc.d/init.d/functions
RFE: better use of functions in /etc/rc.d/init.d/functions
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Miloslav Trmač
Brock Organ
: FutureFeature
Depends On:
Blocks: FC5Target
  Show dependency treegraph
Reported: 2002-04-13 20:37 EDT by Chris Adams
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version: 8.22-1
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-01 13:06:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Remaining patch for redhat-lsb (370 bytes, patch)
2006-01-25 22:10 EST, Miloslav Trmač
no flags Details | Diff

  None (edit)
Description Chris Adams 2002-04-13 20:37:30 EDT
I'm building RPMs for some daemons that don't store their PID file in /var/run
(for example, one does not run as root so doesn't have permission).

There is some code duplication in /etc/rc.d/init.d/functions, especially with
respect to finding the PID of a program.  If everything used pidfileofproc()
instead of doing the lookup itself, it would make it much easier to handle
daemons with non-standard PID file locations (just override pidfileofproc()
instead of having to override a bunch of other things as well).

Also, it would be nice to have an option to daemon() to not limit core dump size
to zero.  I was debugging a daemon, and I explicitly unlimited core dump size
(after making sure that it was in a safe directory, etc.), but I didn't realize
for quite a while that daemon() set core dump size to zero.  That is a sensible
default, but it would be nice to be able to easily override it (otherwise, I
have to write all my init scripts to not use the Red Hat provided functions).
Comment 1 Pekka Savola 2003-07-22 06:33:28 EDT
FWIW, seems a sensible approach.  Further, the initscripts could be extended to
look at pid files under in /var/run/*/*.pid, for exactly the reason stated.  I
maintain one package (radvd) which uses /var/run/radvd/radvd.pid because of the
permissions problem.
Comment 2 Miloslav Trmač 2006-01-25 22:10:31 EST
Created attachment 123705 [details]
Remaining patch for redhat-lsb
Comment 3 Miloslav Trmač 2006-02-01 13:06:56 EST
There is somewhat less code repetition in initscripts-8.22-1, and the
pid file location can be changed.

Core dump size can be defined using $DAEMON_COREFILE_LIMIT.

Thanks for your report.
Comment 4 Chris Adams 2006-02-01 13:23:31 EST
Thanks.  I like using an environment variable for the core file limit; I can
override it for debugging without having to edit scripts that way.

Note You need to log in before you can comment on or make changes to this bug.