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
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miloslav Trmač
QA Contact: Brock Organ
URL:
Whiteboard:
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
Clone Of:
Environment:
Last Closed: 2006-02-01 18:06:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Remaining patch for redhat-lsb (370 bytes, patch)
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/radvd.pid 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.