On Sun, Mar 18, 2012 at 5:23 AM, Pandu Poluan <pa...@poluan.info> wrote: > > On Mar 18, 2012 3:52 PM, "Canek Peláez Valdés" <can...@gmail.com> wrote: >> >> If the config file doesn't exists, the service will not start, and you >> can check the reason why with >> >> systemctl status sshd.service >> >> And of course you can set another mini sevice unit file to create the >> hostkeys. But I repeat: I think those tasks belong into the package >> manager, no the init script. >> > > Between installation by package manager and actual execution by the init > system, things might happen on the required file(s). Gentoo's initscript > guards against this possibility *plus* providing helpful error messages in > /var/rc.log > > Or, said configuration files might be corrupted; the OpenRC initscript -- if > written defensively -- will be able to detect that and (perhaps) fallback to > something sane. systemd can't do that, short of putting all required > intelligence into a script which it executes on boot.
That is a completely valid point, but I don't think that task belongs into the init system. The init system starts and stops services, and monitors them; checking for configuration files and creating hostkeys is part of the installation process. If something got corrupted between installation time and now, I would prefer my init system not to start a service; just please tell me that something is wrong. However, it's of course debatible. I agree with systemd's behavior; it's cleaner, more elegant, and it follows the Unix tradition: do one thing, and doing it right. Regards. -- Canek Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México