Bug 105372

Summary: RFE: Add /etc/inittab.d/ for improved modularity
Product: [Retired] Red Hat Raw Hide Reporter: Bill Rugolsky, Jr. <bill>
Component: SysVinitAssignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: mitr, rvokal
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
URL: ftp://67.83.203.127/pub/sysvinit/sysvinit-2.85-inittabdir.patch
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-28 06:28:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Add support for /etc/inittab.d/
none
Add missing continue statement to stat() error path none

Description Bill Rugolsky, Jr. 2003-09-25 14:48:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703

Description of problem:
The attached patch adds support to SysVinit for optionally splitting all or part
of /etc/inittab into files in /etc/inittab.d.  It accomplishes for supervised
services what /etc/init.d/ provides for unsupervised services. I have submitted
it upstream to Miquel van Smoorenburg <miquels>, but have not heard
back from him yet. I'm posting it here as an RFE to solicit feedback.

The patch currently uses readdir(3), which does not return the file names in
lexicographic order.  It would be trivial to use scandir(3) to sort the file
list, but I have not done so, for two reasons: (1) increased memory usage, and
(2) scandir is a non-POSIX interface.  Is order important?

I chose to ignore hidden files and files ending in '~'; this is fairly common
for other tools that include files from a directory, such as cron or logrotate.

Any comments are welcome; I will be happy to rework it to
your liking, if you are inclined to add this functionality.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
Packages that wish to have their daemons supervised by init need to edit
/etc/inittab on [un]install.  The same is true for dynamically added terminal
devices, e.g., "mgetty ttyACM0".

Additional info:

Comment 1 Bill Rugolsky, Jr. 2003-09-25 14:55:01 UTC
Created attachment 94717 [details]
Add support for /etc/inittab.d/

I'm running this patch on my laptop with all mingetty services in
/etc/inittab.d/tty*.  Adding and removing files and invoking "telinit q" works
as expected. Reading a directory instead of a single file introduces races, but
they seem no worse than similar races elsewhere.

Comment 2 Bill Rugolsky, Jr. 2003-09-25 15:16:37 UTC
Created attachment 94719 [details]
Add missing continue statement to stat() error path

Comment 3 Bill Nottingham 2005-01-28 06:28:31 UTC
Deferring; I'm not quite certain how often use cases for this would
come up from a packaging standpoint that would require a .d directory
(as opposed to a local use standpoint, where editing inittab is simpler.)