[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Two line init.d scripts? Sure, that will work!

On Wed, 5 Feb 2014 22:31:09 +0100
Petter Reinholdtsen <pere@hungry.com> wrote:

> Hi.
> A few months ago I drafted an idea to rewrite init.d scripts to use a
> common implementation and only specify the unique parts in the init.d
> scripts themselves.  That draft can be found on
> <URL:
> http://people.skolelinux.org/pere/blog/Debian_init_d_boot_script_example_for_rsyslog.html
> >.
> The idea is to let init.d scripts look like this:
>   #!/lib/init/init-d-script
>   # Provides:          daemon
>   # Required-Start:    $remote_fs $syslog
>   # Required-Stop:     $remote_fs $syslog
>   # Default-Start:     2 3 4 5
>   # Default-Stop:      0 1 6
>   # Short-Description: nice daemon
>   # Description:       Provide service to others
>   DAEMON=/usr/sbin/daemond

Interesting idea - will there be a half-way implementation for daemons
which require at least some command line options? e.g. logfile and
loglevel? pidfile?

> Short and to the point, and in the simple case only list the path to
> the daemon to start.  The code to implement init.d scripts is moved to
> /lib/init/init-d-script, and the redundant code spread across
> /etc/init.d/ can be dropped.
> A few days ago I picked up the idea again, and wrote a more complete
> draft of the /lib/init/init-d-script.  The code is available in the
> simpler-init-scripts in the sysvinit GIT repository, available from
> <URL:
> http://anonscm.debian.org/gitweb/?p=collab-maint/sysvinit;a=shortlog;h=refs/heads/simpler-init-scripts
> >. I've tested it on a few packages, and believe the code is ready
> >for wider testing.
> The main target group for this feature are the majority of packages
> with init.d scripts, the ones starting a single daemon.  There are
> around 1000 packages in Debian with init.d scripts.  Around 100 of
> them start stuff using rcS.d/, and tend to be quite complex.  Most of
> the rest start a simple daemon and are based on different generations
> of /etc/init.d/skeleton.  The target for this feature is the latter
> group.

I've got a few of those... some in Debian, others not in Debian yet.
> The reason I bring this up on debian-devel@ is twofold.  First, I want
> to gather feedback on the idea.  Will it work for your package, or are
> some more hooks needed?  Second, I wonder where such script best would
> belong.  My initial idea is to put it in the initscripts package,
> installed on almost all Debian systems, but I suspect sysvinit-utils
> is a good place too.  I plan to use the system in the initscripts
> package, and am relucant to add new dependencies to it, as this would
> make the new dependency a required package.

sysvinit-utils sounds good to me.


Neil Williams

Attachment: signature.asc
Description: PGP signature

Reply to: