---- Steffen Nurpmeso schrieb ----

i wrote
||Quoting Alan Mizrahi <alan+crux@mizrahi.com.ve>:
||> So we have two options:
||> 1. Start writing init scripts properly
||> 2. Start using start-stop-daemon
|
|I'm just an .ISO user with occasional updates, but regarding the
|latter it doesn't feel sane to have a ~42 MB file tree laying
|around for a tool that itself consists of 50 KB C code.
|I haven't actually tried it yet, but i gave it a fivteen minute
|quick shot and could compile only start-stop-daemon.c on Crux 3.1
|by applying the attached hacky diff.  Doing something a little bit
|more sane shouldn't cause that much worries given that both Debian
|and Crux are Linux.

and then of course there is the runit [1] init-system.
What worries you at the moment is i guess key of concept for it.

  [1] http://smarden.org/runit/

I have read a lot about it a few months ago, but sorry, i forget
things that are not part of my day-to-day radar pretty fast :(
Anyway, VoidLinux switched over to use it back then, and it seemed
to be pretty painless, for me as an occasional user it definitely
was an absolutely painless transition.  (Their package manager
also seems to be quite a good thing, though other decisions i see
differently.  Anyway.  That is from a user point of view.)  E.g.,
dhcpcd [2] and ssh [3]:

  [2] https://github.com/voidlinux/void-packages/blob/master/srcpkgs/dhcpcd/
  [3] https://github.com/voidlinux/void-packages/blob/master/srcpkgs/openssh/

dhcpcd.service:
  [Unit]
  Description=Lightweight DHCP client daemon
  Wants=network.target
  Before=network.target

  [Service]
  Type=forking
  PIDFile=/run/dhcpcd.pid
  ExecStart=/usr/sbin/dhcpcd -q -b
  ExecStop=/usr/sbin/dhcpcd -x

  [Install]
  WantedBy=multi-user.target

dhcpcd/run:
  #!/bin/sh
  [ -r conf ] && . ./conf
  exec dhcpcd -B ${OPTS:=-M}

sshd.service:
  # Note that this is the service file for running a single SSH server for all
  # incoming connections, suitable only for systems with a large amount of SSH
  # traffic. In almost all other cases it is a better idea to use sshd.socket +
  # sshd@.service (i.e. the on-demand spawning version for one instance per
  #  connection).
  [Unit]
  Description=SSH Secure Shell Service
  Wants=sshdgenkeys.service
  After=sshdgenkeys.service
  After=network.target

  [Service]
  ExecStart=/usr/sbin/sshd -D

  [Install]
  WantedBy=multi-user.target

sshd/run:
  #!/bin/sh
  ssh-keygen -A >/dev/null 2>&1 # [COMMENT STRIPPED]
  [ -r conf ] && . ./conf
  exec /usr/sbin/sshd -D $OPTS

|Unless the plan is to use more tools from dpkg, of course...

I'd also be willing to track changes on start-stop-daemon.c and
"maintain" a CRUX-specific patch and Makefile for it alone.
It really shouldn't cause any work at all (except of course that
freely configurable kernels and programs with fixed compiled
features don't fit, but this is a general problem, is it).
I'm just looking into it and i wonder wether the patch i have sent
isn't enough already.

--steffen
_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
https://lists.crux.nu/mailman/listinfo/crux