Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 63440 - RFE: better use of functions in /etc/rc.d/init.d/functions
Summary: RFE: better use of functions in /etc/rc.d/init.d/functions
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Miloslav Trmač
QA Contact: Brock Organ
Depends On:
Blocks: FC5Target
TreeView+ depends on / blocked
Reported: 2002-04-14 00:37 UTC by Chris Adams
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version: 8.22-1
Doc Type: Enhancement
Doc Text:
Clone Of:
Last Closed: 2006-02-01 18:06:56 UTC

Attachments (Terms of Use)
Remaining patch for redhat-lsb (deleted)
2006-01-26 03:10 UTC, Miloslav Trmač
no flags Details | Diff

Description Chris Adams 2002-04-14 00:37:30 UTC
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 10:33:28 UTC
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/ because of the
permissions problem.

Comment 2 Miloslav Trmač 2006-01-26 03:10:31 UTC
Created attachment 123705 [details]
Remaining patch for redhat-lsb

Comment 3 Miloslav Trmač 2006-02-01 18:06:56 UTC
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 18:23:31 UTC
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.