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

Bug#727708: tech-ctte: Decide which init system to default to in Debian.



On Wed, 30 Oct 2013 21:50:53 -0400, Theodore Ts'o wrote:
>
> It's not necessarily the init script author who might want the degrees
> of freedom, but the local system administrator.
>
> The most basic is the idea that whether you can control (via shell
> scrpit fragments) whether or not a service should start at all, and
> what options or environments should be enabled by pasing some file.
> The fact that we can put that sort of thing in configuration files
> such as /etc/default/*, for example.
>
> Yes, yes, you can do this via if you use system V init scripts scripts
> in backwards compatibility mode, but you've argued that we should be
> moving briskly away from that. In which case system administrators
> will need to hand-edit the services files by hand, which will no doubt
> increase the chances of conflicts at package upgrade time, compared to
> if the configuration options were isolated away in files such as
> /etc/default/rsync (for example).

Both upstart and systemd allow you to source any file and run any script from their .conf/.service files.

In Fedora 19:

You can source anything with "EnvironmentFile=" and run anything from "ExecStartPre=", "ExecStart=", "ExecStartPost=".

"/usr/lib/systemd/system/iptables.service" has "ExecStart=/usr/libexec/iptables/iptables.init start" where "/usr/libexec/iptables/iptables.init" is the "/etc/rc.d/init.d/iptables" sysvinit script of Fedora 15.

iptables also has "/usr/libexec/initscripts/legacy-actions/iptables/save" and it runs "exec /usr/libexec/iptables/iptables.init save".

Also, "/usr/lib/systemd/system/nfs-server.service" sources "/etc/sysconfig/nfs" with "EnvironmentFile=/etc/sysconfig/nfs" and runs scripts in "/usr/lib/nfs-utils/scripts/".

(It's surprising that there isn't a canonical location for custom systemd scripts. I don't have an Arch instance on which to check, but AFAIK its iptables.service calls a script that's in "/usr/lib/systemd/scripts/".)

In Ubuntu 13.10:

I would've liked to compare like for like but neither iptables-persistent and nfs-kernel-server have upstart jobs.

Let's assume that "/etc/init/nfs-kernel-server.conf" exists and that you want to override it.

# vi /etc/init/nfs-kernel-server.override
...
script
[ -r /home/ted/ted-nfs-kernel-server ] \
      && . /home/ted/ted-nfs-kernel-server
<either call a script or put your commands here>
end script


Reply to: