[Pkg-sysvinit-devel] Bug#464854: skeleton: Move skeleton code into a file that other scripts can include
Petter Reinholdtsen
pere at hungry.com
Tue Feb 4 23:07:13 UTC 2014
[Olaf van der Spek]
> Would it be possible to move common code from skeleton into another
> file like /lib/lsb/init-functions such that code doesn't have to be
> duplicated? The start|stop|restart|reload|force-reload case statement
> looks like a good candidate and default do_start and do_stop scripts
> (with optional callbacks) would be good as well.
I've started on a draft to get something like this into Debian. The
simpler-init-scripts git branch available from
<URL: http://anonscm.debian.org/gitweb/?p=collab-maint/sysvinit;a=shortlog;h=refs/heads/simpler-init-scripts >
implement a wrapper script init-d-script that can be used like this to
get most of the init.d script implemented as a "include":
#!/lib/init/init-d-script
### BEGIN INIT INFO
# Provides: atd
# Required-Start: $syslog $time $remote_fs
# Required-Stop: $syslog $time $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Deferred execution scheduler
# Description: Debian init script for the atd deferred executions
# scheduler
### END INIT INFO
DESC="deferred execution scheduler"
DAEMON=/usr/sbin/atd
Only DESC and DAEMON need to be set. Other settings can be overriden
either by using variables or functions. Would this fit your need?
Please test and let us know if it work for you. :)
--
Happy hacking
Petter Reinholdtsen
More information about the Pkg-sysvinit-devel
mailing list